- Added GTK+-based clipboard support for Linux.

- Fixed: Most Linux filesystems do not fill in d_type for scandir(), so we
  cannot rely on it to detect directories.
- Added NicePath() function to perform shell-style ~ substitution on path
  names.
- Changed the default screenshot directory on Unix to ~/.zdoom/screenshots/.
- Added -shotdir command line option to temporarily override the
  screenshot_dir cvar.



SVN r1413 (trunk)
This commit is contained in:
Randy Heit 2009-02-08 02:52:43 +00:00
commit be165578ea
7 changed files with 199 additions and 69 deletions

View file

@ -505,7 +505,7 @@ CCMD (error_fatal)
CCMD (dir)
{
FString dir;
FString dir, path;
char curdir[256];
const char *match;
findstate_t c_file;
@ -517,38 +517,45 @@ CCMD (dir)
return;
}
if (argv.argc() == 1 || chdir (argv[1]))
if (argv.argc() > 1)
{
match = argv.argc() == 1 ? "./*" : argv[1];
dir = ExtractFilePath (match);
if (dir[0] != '\0')
path = NicePath(argv[1]);
if (chdir(path))
{
match += dir.Len();
match = path;
dir = ExtractFilePath(path);
if (dir[0] != '\0')
{
match += dir.Len();
}
else
{
dir = "./";
}
if (match[0] == '\0')
{
match = "*";
}
if (chdir (dir))
{
Printf ("%s not found\n", dir.GetChars());
return;
}
}
else
{
dir = "./";
}
if (match[0] == '\0')
{
match = "*";
}
if (chdir (dir))
{
Printf ("%s not found\n", dir.GetChars());
return;
dir = path;
}
}
else
{
match = "*";
dir = argv[1];
if (dir[dir.Len()-1] != '/')
{
dir += '/';
}
dir = curdir;
}
if (dir[dir.Len()-1] != '/')
{
dir += '/';
}
if ( (file = I_FindFirst (match, &c_file)) == ((void *)(-1)))