Changeset 2713 in MondoRescue for branches/2.2.9/mondo/src/common/libmondo-filelist.c
- Timestamp:
- Feb 2, 2011, 12:35:51 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/common/libmondo-filelist.c
r2711 r2713 1295 1295 mr_asprintf(&sz_res, "%s", incoming); 1296 1296 p = sz_res; 1297 while ((*p != ' 1297 while ((*p != '|' || in_quotes) && *p != '\0') { 1298 1298 if (*p == '\"') { 1299 1299 in_quotes = !in_quotes; … … 1326 1326 time_t time_of_last_full_backup) 1327 1327 { 1328 const char delims[] = " 1328 const char delims[] = "|"; 1329 1329 1330 1330 DIR *dip; … … 1336 1336 static int percentage = 0; 1337 1337 char *skip_these; 1338 char *new_with_ spaces;1338 char *new_with_pipe; 1339 1339 char *strtmp; 1340 1340 char *token; … … 1434 1434 1435 1435 // log_msg(0, "Cataloguing %s", dir); 1436 if (sth[0] == ' ') { 1437 mr_asprintf(&skip_these, "%s", sth); 1438 } else { 1439 mr_asprintf(&skip_these, " %s ", sth); 1440 } 1441 mr_asprintf(&new_with_spaces, " %s ", dir1); 1436 mr_asprintf(&skip_these, "|%s|", sth); 1437 1438 mr_asprintf(&new_with_pipe, "|%s|", dir1); 1442 1439 if ((dip = opendir(dir1)) == NULL) { 1443 1440 mr_asprintf(&tmp,"opendir %s", dir1); 1444 1441 log_OS_error(tmp); 1445 1442 paranoid_free(tmp); 1446 } else if (strstr(skip_these, new_with_ spaces)) {1443 } else if (strstr(skip_these, new_with_pipe)) { 1447 1444 log_msg(10, "Found dir ***%s**** excluded", dir1); 1448 1445 fprintf(fout, "%s\n", dir1); // if excluded dir then print dir ONLY … … 1457 1454 mr_asprintf(&new,"%s%s",dir1,dit->d_name); 1458 1455 } 1459 paranoid_free(new_with_ spaces);1460 mr_asprintf(&new_with_ spaces, " %s", new);1461 if (strstr(skip_these, new_with_ spaces)) {1456 paranoid_free(new_with_pipe); 1457 mr_asprintf(&new_with_pipe, "|%s|", new); 1458 if (strstr(skip_these, new_with_pipe)) { 1462 1459 fprintf(fout, "%s\n", new); 1463 1460 log_msg(10, "Found child dir ***%s**** excluded", new); 1464 paranoid_free(new_with_ spaces);1461 paranoid_free(new_with_pipe); 1465 1462 } else { 1466 paranoid_free(new_with_ spaces);1463 paranoid_free(new_with_pipe); 1467 1464 if (!lstat(new, &statbuf)) { 1468 1465 if (!S_ISLNK(statbuf.st_mode) … … 1497 1494 } 1498 1495 } 1499 paranoid_free(new_with_ spaces);1496 paranoid_free(new_with_pipe); 1500 1497 paranoid_free(skip_these); 1501 1498 mr_free(dir); … … 1538 1535 char *p, *q; 1539 1536 char *sz_datefile; 1540 char *sz_filelist, *exclude_paths, *tmp; 1537 char *sz_filelist, *tmp; 1538 char *exclude_paths = NULL; 1541 1539 int i; 1542 1540 FILE *fout; … … 1549 1547 malloc_string(tmp); 1550 1548 malloc_string(g_skeleton_filelist); 1551 if (!(exclude_paths = malloc(8*MAX_STR_LEN))) {1552 fatal_error("Cannot malloc exclude_paths");1553 }1554 1549 mr_asprintf(&sz_datefile,MONDO_CACHE"/difflevel.%d" , 0); 1555 1550 if (!include_paths && !userdef_filelist) { … … 1619 1614 paranoid_free(tmp1); 1620 1615 1621 snprintf(exclude_paths, (size_t)8*MAX_STR_LEN," %s %s %s %s %s . .. \ 1622 " MNT_CDROM " " MNT_FLOPPY " /media /tmp \ 1623 /proc /sys /dev/shm " MINDI_CACHE, MONDO_CACHE, excp, tmp2, (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir); 1616 mr_asprintf(&exclude_paths, MONDO_CACHE"|%s|%s|%s|%s|.|..|"MNT_CDROM"|"MNT_FLOPPY"|/media|/tmp|/proc|/sys|/dev/shm|"MINDI_CACHE,excp, tmp2, (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir); 1624 1617 paranoid_free(tmp2); 1625 1618 … … 1648 1641 p += strlen(q); 1649 1642 paranoid_free(q); 1650 while (*p == ' 1643 while (*p == '|') { 1651 1644 p++; 1652 1645 }
Note:
See TracChangeset
for help on using the changeset viewer.