mirror of
https://github.com/scummvm/scummvm-tools.git
synced 2026-05-21 05:40:44 +00:00
Fixed a bug when splitting the filename specified on the command line into a filename and path. Also moved this code into util.c as it is used by almost all of the compression/extraction tools..
svn-id: r28573
This commit is contained in:
+4
-9
@@ -778,17 +778,12 @@ int main(int argc, char *argv[]) {
|
||||
i = argc - 1;
|
||||
|
||||
// get filename prefix
|
||||
char prefix[256];
|
||||
char *filename = argv[i++];
|
||||
char prefix[256];
|
||||
char *p;
|
||||
|
||||
getFilename(filename, prefix);
|
||||
|
||||
char *p = strrchr(filename, '/');
|
||||
if (!p) {
|
||||
p = strrchr(filename, '\\');
|
||||
if (!p) {
|
||||
p = filename - 1;
|
||||
}
|
||||
}
|
||||
strcpy(prefix, p + 1);
|
||||
p = strrchr(prefix, '.');
|
||||
if (p) {
|
||||
*p = '\0';
|
||||
|
||||
Reference in New Issue
Block a user