Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
abspath.c: have SP around arithmetic operators
author
Junio C Hamano
<gitster@pobox.com>
Tue, 15 Oct 2013 22:25:45 +0000
(15:25 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 16 Oct 2013 17:27:26 +0000
(10:27 -0700)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
abspath.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
cc10837
)
diff --git
a/abspath.c
b/abspath.c
index 64adbe2a1b5e5679fb0dc772452b4aca1865ee4c..e390994abff32054452e878484e79c249474389f 100644
(file)
--- a/
abspath.c
+++ b/
abspath.c
@@
-110,7
+110,7
@@
static const char *real_path_internal(const char *path, int die_on_error)
else
goto error_out;
}
else
goto error_out;
}
- if (len && !is_dir_sep(buf[len
-
1]))
+ if (len && !is_dir_sep(buf[len
-
1]))
buf[len++] = '/';
strcpy(buf + len, last_elem);
free(last_elem);
buf[len++] = '/';
strcpy(buf + len, last_elem);
free(last_elem);
@@
-201,7
+201,7
@@
const char *absolute_path(const char *path)
if (!cwd)
die_errno("Cannot determine the current working directory");
len = strlen(cwd);
if (!cwd)
die_errno("Cannot determine the current working directory");
len = strlen(cwd);
- fmt = (len > 0 && is_dir_sep(cwd[len
-
1])) ? "%s%s" : "%s/%s";
+ fmt = (len > 0 && is_dir_sep(cwd[len
-
1])) ? "%s%s" : "%s/%s";
if (snprintf(buf, PATH_MAX, fmt, cwd, path) >= PATH_MAX)
die("Too long path: %.*s", 60, path);
}
if (snprintf(buf, PATH_MAX, fmt, cwd, path) >= PATH_MAX)
die("Too long path: %.*s", 60, path);
}