HuntnGather – Diff between revs 15 and 16

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 15 Rev 16
Line 197... Line 197...
197 // Check if CTRL+C was pressed and abort the program. 197 // Check if CTRL+C was pressed and abort the program.
198 if(SetSignal(0L, SIGBREAKF_CTRL_C) & SIGBREAKF_CTRL_C) { 198 if(SetSignal(0L, SIGBREAKF_CTRL_C) & SIGBREAKF_CTRL_C) {
199 run = FALSE; 199 run = FALSE;
200 } 200 }
201 #endif 201 #endif
202 if((path = stringStackPop(dirStack)) == NULL) { 202 if((path = stringStackPop(dirStack)) == NULL ||
-   203 strlen(path) == 0) {
203 return; 204 return;
204 } 205 }
Line 205... Line 206...
205   206  
206 if((dir = opendir(path)) == NULL) { 207 if((dir = opendir(path)) == NULL) {
Line 283... Line 284...
283 FILE *fp; 284 FILE *fp;
284 int size; 285 int size;
Line 285... Line 286...
285   286  
286 if((fp = fopen(dbFile, "r")) == NULL) { 287 if((fp = fopen(dbFile, "r")) == NULL) {
287 fprintf(stderr, "Unable to open gather database for reading.\n"); -  
288 fclose(fp); 288 fprintf(stderr, "Unable to open gather database for reading.\n");
289 return 0; 289 return 0;
Line 290... Line 290...
290 } 290 }
291   291  
Line 305... Line 305...
305 int lines; 305 int lines;
306 char c; 306 char c;
Line 307... Line 307...
307   307  
308 if((fp = fopen(dbFile, "r")) == NULL) { 308 if((fp = fopen(dbFile, "r")) == NULL) {
309 fprintf(stderr, "Unable to open gather database for reading.\n"); -  
310 fclose(fp); 309 fprintf(stderr, "Unable to open gather database for reading.\n");
311 return 0; 310 return 0;
Line 312... Line 311...
312 } 311 }
313   312  
Line 376... Line 375...
376 return; 375 return;
377 } 376 }
Line 378... Line 377...
378   377  
379 if((tp = fopen(tmpNames[--tmpFiles], "w+")) == NULL) { 378 if((tp = fopen(tmpNames[--tmpFiles], "w+")) == NULL) {
380 fprintf(stderr, "Unable to open temporary file '%s' for writing.\n", tmpNames[tmpFiles]); -  
381 fclose(fp); 379 fprintf(stderr, "Unable to open temporary file '%s' for writing.\n", tmpNames[tmpFiles]);
382 return; 380 return;
Line 383... Line 381...
383 } 381 }
384   382  
Line 405... Line 403...
405 } 403 }
Line 406... Line 404...
406   404  
407 // Write the newline character back. 405 // Write the newline character back.
408 if(fprintf(tp, "%c", c) != 1) { 406 if(fprintf(tp, "%c", c) != 1) {
409 fprintf(stderr, "Unable to write to temporary file '%s'.\n", tmpNames[tmpFiles]); -  
410 fclose(tp); 407 fprintf(stderr, "Unable to write to temporary file '%s'.\n", tmpNames[tmpFiles]);
411 fclose(fp); 408 fclose(fp);
412 return; 409 return;
413 } 410 }
414 // Switch to the next temporary file. 411 // Switch to the next temporary file.
Line 420... Line 417...
420   417  
421 // Close the previous temporary file and write to the next temporary file. 418 // Close the previous temporary file and write to the next temporary file.
422 fclose(tp); 419 fclose(tp);
423 if((tp = fopen(tmpNames[--tmpFiles], "w+")) == NULL) { 420 if((tp = fopen(tmpNames[--tmpFiles], "w+")) == NULL) {
424 fprintf(stderr, "Unable to open temporary file '%s' for writing.\n", tmpNames[tmpFiles]); -  
425 fclose(tp); 421 fprintf(stderr, "Unable to open temporary file '%s' for writing.\n", tmpNames[tmpFiles]);
426 fclose(fp); 422 fclose(fp);
427 } 423 }
428 lines = 0; 424 lines = 0;
429 break; 425 break;