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:
Sean Murray
2007-08-13 02:47:30 +00:00
parent 03679fe1e2
commit 2fd489065d
14 changed files with 70 additions and 267 deletions
+4 -9
View File
@@ -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';