Changeset 465 in MondoRescue
- Timestamp:
- Apr 8, 2006, 10:58:50 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/mondo/mondoarchive/mondo-cli.c
r395 r465 356 356 /*@ buffers ** */ 357 357 char *tmp; 358 char *tmp1; 358 359 char *psz; 359 360 … … 442 443 strcat(bkpinfo->include_paths, " "); 443 444 } 444 if (stat(flag_val['I'], &buf) != 0) { 445 log_msg(1, "ERROR ! %s doesn't exist", flag_val['I']); 446 fatal_error("ERROR ! You specified a directory to include which doesn't exist"); 447 } 445 asprintf(&tmp1, flag_val['I']); 446 char *p = tmp1; 447 char *q = tmp1; 448 449 /* Cut the flag_val['I'] in parts containing all paths to test them */ 450 while (p != NULL) { 451 q = strchr(p, ' '); 452 if (q != NULL) { 453 *q = '\0'; 454 p = q+1 ; 455 if (stat(p, &buf) != 0) { 456 log_msg(1, "ERROR ! %s doesn't exist", p); 457 fatal_error("ERROR ! You specified a directory to include which doesn't exist"); 458 } 459 } else { 460 if (stat(p, &buf) != 0) { 461 log_msg(1, "ERROR ! %s doesn't exist", p); 462 fatal_error("ERROR ! You specified a directory to include which doesn't exist"); 463 } 464 p = NULL; 465 } 466 } 467 paranoid_free(tmp1); 468 448 469 strncpy(bkpinfo->include_paths + strlen(bkpinfo->include_paths), 449 470 flag_val['I'], … … 659 680 strcat(bkpinfo->exclude_paths, " "); 660 681 } 661 if (stat(flag_val['E'], &buf) != 0) { 662 log_msg(1, "WARNING ! %s doesn't exist", flag_val['E']); 663 } 682 asprintf(&tmp1, flag_val['E']); 683 char *p = tmp1; 684 char *q = tmp1; 685 686 /* Cut the flag_val['E'] in parts containing all paths to test them */ 687 while (p != NULL) { 688 q = strchr(p, ' '); 689 if (q != NULL) { 690 *q = '\0'; 691 p = q+1 ; 692 if (stat(p, &buf) != 0) { 693 log_msg(1, "WARNING ! %s doesn't exist", p); 694 } 695 } else { 696 if (stat(p, &buf) != 0) { 697 log_msg(1, "WARNING ! %s doesn't exist", p); 698 } 699 p = NULL; 700 } 701 } 702 paranoid_free(tmp1); 703 664 704 strncpy(bkpinfo->exclude_paths + strlen(bkpinfo->exclude_paths), 665 705 flag_val['E'],
Note:
See TracChangeset
for help on using the changeset viewer.