aboutsummaryrefslogtreecommitdiff
path: root/jim-file.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2012-01-19 11:11:59 +1000
committerSteve Bennett <steveb@workware.net.au>2012-01-19 11:13:04 +1000
commit01cf806d4bc5a87170acbece47d42dd33a092d8d (patch)
treec3c7c0cfcac3878ba0825caacc5eb19587f7415f /jim-file.c
parent46fb9d7ffdce5ccb7375f8ca86eca6d328e6363d (diff)
downloadjimtcl-01cf806d4bc5a87170acbece47d42dd33a092d8d.zip
jimtcl-01cf806d4bc5a87170acbece47d42dd33a092d8d.tar.gz
jimtcl-01cf806d4bc5a87170acbece47d42dd33a092d8d.tar.bz2
Fix some warnings identified by icc
The Intel C Compiler Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-file.c')
-rw-r--r--jim-file.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/jim-file.c b/jim-file.c
index 725cc8a..053873c 100644
--- a/jim-file.c
+++ b/jim-file.c
@@ -430,14 +430,16 @@ static int mkdir_all(char *path)
while (ok--) {
/* Must have failed the first time, so recursively make the parent and try again */
- char *slash = strrchr(path, '/');
+ {
+ char *slash = strrchr(path, '/');
- if (slash && slash != path) {
- *slash = 0;
- if (mkdir_all(path) != 0) {
- return -1;
+ if (slash && slash != path) {
+ *slash = 0;
+ if (mkdir_all(path) != 0) {
+ return -1;
+ }
+ *slash = '/';
}
- *slash = '/';
}
first:
if (MKDIR_DEFAULT(path) == 0) {