Changeset 2715 in MondoRescue for branches/2.2.10/mondo/src/common/libmondo-filelist.c
- Timestamp:
- Feb 2, 2011, 1:18:23 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-filelist.c
r2704 r2715 1283 1283 mr_asprintf(sz_res, "%s", incoming); 1284 1284 p = sz_res; 1285 while ((*p != ' 1285 while ((*p != '|' || in_quotes) && *p != '\0') { 1286 1286 if (*p == '\"') { 1287 1287 in_quotes = !in_quotes; … … 1311 1311 int open_and_list_dir(char *dir1, char *sth, FILE * fout, time_t time_of_last_full_backup) { 1312 1312 1313 const char delims[] = " 1313 const char delims[] = "|"; 1314 1314 1315 1315 DIR *dip; … … 1322 1322 static int percentage = 0; 1323 1323 char *skip_these = NULL; 1324 char *new_with_ spaces = NULL;1324 char *new_with_pipe; 1325 1325 char *strtmp; 1326 1326 char *token; … … 1347 1347 } 1348 1348 } 1349 mr_asprintf(&find_excludes, "|"); 1349 1350 1350 1351 if (!depth) { 1351 mr_asprintf(find_excludes, " 1352 mr_asprintf(find_excludes, "|"); 1352 1353 if (sth != NULL) { 1353 1354 while((token = mr_strtok(sth, delims, &lastpos))) { … … 1417 1418 1418 1419 // log_msg(0, "Cataloguing %s", dir); 1419 if (sth[0] == ' ') { 1420 mr_asprintf(skip_these, "%s", sth); 1421 } else { 1422 mr_asprintf(skip_these, " %s ", sth); 1423 } 1424 mr_asprintf(new_with_spaces, " %s ", dir1); 1420 mr_asprintf(skip_these, "|%s|", sth); 1421 mr_asprintf(new_with_pipe, "|%s|", dir1); 1425 1422 if ((dip = opendir(dir1)) == NULL) { 1426 1423 mr_asprintf(tmp,"opendir %s", dir1); 1427 1424 log_OS_error(tmp); 1428 1425 mr_free(tmp); 1429 } else if (strstr(skip_these, new_with_ spaces)) {1426 } else if (strstr(skip_these, new_with_pipe)) { 1430 1427 log_msg(10, "Found dir ***%s**** excluded", dir1); 1431 1428 fprintf(fout, "%s\n", dir1); // if excluded dir then print dir ONLY … … 1440 1437 mr_asprintf(new,"%s%s",dir1,dit->d_name); 1441 1438 } 1442 mr_free(new_with_ spaces);1443 mr_asprintf(new_with_spaces, " %s", new);1444 if (strstr(skip_these, new_with_ spaces)) {1439 mr_free(new_with_pipe); 1440 mr_asprintf(new_with_spaces, "|%s|", new); 1441 if (strstr(skip_these, new_with_pipe)) { 1445 1442 fprintf(fout, "%s\n", new); 1446 1443 log_msg(10, "Found child dir ***%s**** excluded", new); 1447 mr_free(new_with_ spaces);1444 mr_free(new_with_pipe); 1448 1445 } else { 1449 mr_free(new_with_ spaces);1446 mr_free(new_with_pipe); 1450 1447 if (!lstat(new, &statbuf)) { 1451 1448 if (!S_ISLNK(statbuf.st_mode) … … 1474 1471 } 1475 1472 } 1476 mr_free(new_with_ spaces);1473 mr_free(new_with_pipe); 1477 1474 mr_free(skip_these); 1478 1475 mr_free(dir); … … 1584 1581 mr_free(tmp1); 1585 1582 1586 mr_asprintf(exclude_paths, " %s %s %s %s %s . .. " MNT_CDROM " " MNT_FLOPPY " /media /tmp /proc /sys /dev/shm " MINDI_CACHE, MONDO_CACHE, (excp == NULL) ? "" : excp, tmp2, (bkpinfo->tmpdir[0] == '/' && bkpinfo->tmpdir[1] == '/') ? (bkpinfo->tmpdir + 1) : bkpinfo->tmpdir, (bkpinfo->scratchdir[0] == '/' && bkpinfo->scratchdir[1] == '/') ? (bkpinfo->scratchdir + 1) : bkpinfo->scratchdir); 1587 mr_free(tmp2); 1583 mr_asprintf(exclude_paths, MONDO_CACHE"|%s|%s|%s|%s|.|..|"MNT_CDROM"|"MNT_FLOPPY"|/media|/tmp|/proc|/sys|/dev/shm|"MINDI_CACHE,(excp == NULL) ? "" : excp, tmp2, (bkpinfo->tmpdir[0] == '/' && bkpinfo->tmpdir[1] == '/') ? (bkpinfo->tmpdir + 1) : bkpinfo->tmpdir, (bkpinfo->scratchdir[0] == '/' && bkpinfo->scratchdir[1] == '/') ? (bkpinfo->scratchdir + 1) : bkpinfo->scratchdir); 1588 1584 1589 1585 log_msg(2, "Excluding paths = '%s'", exclude_paths); … … 1610 1606 p += strlen(q); 1611 1607 paranoid_free(q); 1612 while (*p == ' 1608 while (*p == '|') { 1613 1609 p++; 1614 1610 }
Note:
See TracChangeset
for help on using the changeset viewer.