Changeset 2506


Ignore:
Timestamp:
Jan 4, 2010, 11:31:53 AM (10 years ago)
Author:
bruno
Message:
  • Fix a bug when isodir is / only when splitting it in iso_path and iso_mnt
Location:
branches
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/common/libmondo-tools.c

    r2475 r2506  
    586586            mr_asprintf(iso_path, "%s", "");
    587587        } else {
    588             mr_asprintf(iso_path, "%s", iso_tmp + strlen(iso_mnt));
     588            // If iso_mnt is only / then iso_path is the full dir
     589            // (the formula bellow doesn't work in this case)
     590            if (strcmp(iso_mnt, "/") == 0) {
     591                mr_asprintf(iso_path, "%s", iso_tmp);
     592            // else it's a part of iso_tmp
     593            } else {
     594                mr_asprintf(iso_path, "%s", iso_tmp + strlen(iso_mnt));
     595            }
    589596        }
    590597        mr_free(iso_mnt);
  • branches/2.2.9/mondo/src/common/libmondo-tools.c

    r2470 r2506  
    610610            iso_path[0] = '\0';
    611611        } else {
    612             sprintf(iso_path, "%s", iso_tmp + strlen(iso_mnt));
     612            // If iso_mnt is only / then iso_path is the full dir
     613            // (the formula bellow doesn't work in this case)
     614            if (strcmp(iso_mnt, "/") == 0) {
     615                sprintf(iso_path, "%s", iso_tmp);
     616            // else it's a part of iso_tmp
     617            } else {
     618                sprintf(iso_path, "%s", iso_tmp + strlen(iso_mnt));
     619            }
    613620        }
    614621        sprintf(tmp, "%s/ISODIR", bkpinfo->tmpdir);
Note: See TracChangeset for help on using the changeset viewer.