HuntnGather
/trunk/HuntnGather/Gather/Gather.c |
@@ -654,10 +654,10 @@ |
struct RDArgs *rdargs; |
struct stat statPath; |
UBYTE *dbFile; |
UBYTE *argPath; |
UBYTE *argPattern; |
|
dbFile = DEFAULT_DATABASE_FILE; |
argPath = NULL; |
argPattern = NULL; |
if(rdargs = (struct RDArgs *) AllocDosObject(DOS_RDARGS, NULL)) { |
if(ReadArgs(TEMPLATE, result, rdargs) == NULL) { |
FreeArgs(rdargs); |
@@ -669,27 +669,19 @@ |
dbFile = (UBYTE *) result[OPT_DATABASE]; |
} |
|
if(result[OPT_QUIET]) { |
verbose = FALSE; |
} |
argPattern = (UBYTE *) result[OPT_PATH]; |
|
argPath = (UBYTE *) result[OPT_PATH]; |
|
FreeArgs(rdargs); |
FreeDosObject(DOS_RDARGS, rdargs); |
} |
|
stat(argPath, &statPath); |
if(!S_ISDIR(statPath.st_mode)) { |
fprintf(stderr, "Path '%s' is not a directory.\n", argPath); |
stat(dbFile, &statPath); |
if(!S_ISREG(statPath.st_mode)) { |
fprintf(stderr, "Database file '%s' is not a file.\n", dbFile); |
return 1; |
} |
|
if(verbose) { |
fprintf(stdout, "Gathering to database file: %s\n", dbFile); |
} |
|
Gather(dbFile, argPath); |
Gather(dbFile, argPattern); |
#else |
int option; |
char *dbFile; |