Changeset 2934


Ignore:
Timestamp:
Jan 25, 2012, 12:46:02 AM (6 years ago)
Author:
bruno
Message:
  • Fix #579 by checking with pipes on both sides of the string
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mondo/src/common/libmondo-devices.c

    r2933 r2934  
    20632063char *tmp = NULL;
    20642064char *tmp1 = NULL;
     2065char *tmp2 = NULL;
    20652066
    20662067if (pathlist == NULL) {
     
    21192120        /*  Adds a | to ensure correct detection even at both ends */
    21202121        mr_asprintf(&tmp1,"|%s",token);
     2122        mr_asprintf(&tmp2,"|%s|",token);
    21212123        if (mode == 'E') {
    21222124            /*  Add the token if not already in the list */
    21232125            mr_asprintf(&tmp,"|%s|",bkpinfo->exclude_paths);
    2124             if (strstr(tmp,tmp1) == NULL) {
     2126            if (strstr(tmp,tmp2) == NULL) {
    21252127                if (bkpinfo->exclude_paths) {
    21262128                    mr_strcat(bkpinfo->exclude_paths,tmp1);
     
    21332135            /*  Add the token if not already in the list */
    21342136            mr_asprintf(&tmp,"|%s|",bkpinfo->include_paths);
    2135             if (strstr(tmp,tmp1) == NULL) {
     2137            if (strstr(tmp,tmp2) == NULL) {
    21362138                strcat(bkpinfo->include_paths,tmp1);
    21372139            }
     
    21392141        }
    21402142        mr_free(tmp);
     2143        mr_free(tmp2);
    21412144        break;
    21422145    }
Note: See TracChangeset for help on using the changeset viewer.