summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-29 15:41:34 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-29 15:41:34 (GMT)
commit21c7454250982d2cc4abd9d5cfe916f3640dc1ee (patch)
tree4b10e8e4f7a717b7914e9037b20956c0bf20d946 /Utilities
parentcef4806c88ce99ce8ce81e3234329b74d467f35c (diff)
downloadCMake-21c7454250982d2cc4abd9d5cfe916f3640dc1ee.zip
CMake-21c7454250982d2cc4abd9d5cfe916f3640dc1ee.tar.gz
CMake-21c7454250982d2cc4abd9d5cfe916f3640dc1ee.tar.bz2
BUG: Fix extract. Looks like dirname actually changes the string, so temporary string should be used
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmtar/extract.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Utilities/cmtar/extract.c b/Utilities/cmtar/extract.c
index b096500..b61bd97 100644
--- a/Utilities/cmtar/extract.c
+++ b/Utilities/cmtar/extract.c
@@ -213,8 +213,14 @@ tar_extract_regfile(TAR *t, char *realname)
uid = th_get_uid(t);
gid = th_get_gid(t);
- if (mkdirhier(dirname(filename)) == -1)
+ strncpy(buf, filename, sizeof(buf)-1);
+ buf[sizeof(buf)-1] = 0;
+
+
+ if (mkdirhier(dirname(buf)) == -1)
+ {
return -1;
+ }
#ifdef DEBUG
printf(" ==> extracting: %s (mode %04o, uid %d, gid %d, %d bytes)\n",