From 46293e457b44fb2031b8e36e9064cd3f2b73b6b8 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 27 Feb 2012 14:52:17 +0000 Subject: [PATCH] Fixed a problem with directing an -extract to the / directory of disk --- xorriso/disk_ops.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xorriso/disk_ops.c b/xorriso/disk_ops.c index 8b3d1e6e..591d62f8 100644 --- a/xorriso/disk_ops.c +++ b/xorriso/disk_ops.c @@ -1679,10 +1679,13 @@ int Xorriso_make_restore_path(struct XorrisO *xorriso, } if(strlen(dpfx) + strlen(img_path) - li + 1 >= SfileadrL) return(-1); - if(img_path[li]=='/') - sprintf(disk_path, "%s/%s", dpfx, img_path + li + 1); - else - strcpy(disk_path, dpfx); + if(img_path[li]=='/') { + if(dpfx[0] == '/' && dpfx[1] == 0) + sprintf(disk_path, "/%s", img_path + li + 1); + else + sprintf(disk_path, "%s/%s", dpfx, img_path + li + 1); + } else + strcpy(disk_path, dpfx); /* img_path[li] is 0, img_path equals ipfx */ found_s= s; found_d= d; if(s != *img_prefixes || !(flag & 1))