Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xt/t7502-status.sh2
-rw-r--r--wt-status.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/t/t7502-status.sh b/t/t7502-status.sh
index 269b3341a2..d6ae69d46e 100755
--- a/t/t7502-status.sh
+++ b/t/t7502-status.sh
@@ -68,7 +68,7 @@ cat > expect << \EOF
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
#
-# modified: ../dir1/modified
+# modified: modified
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
diff --git a/wt-status.c b/wt-status.c
index 0e0439f2c2..52ab41ceb6 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -82,12 +82,13 @@ static void wt_status_print_trailer(struct wt_status *s)
}
static char *quote_path(const char *in, int len,
- struct strbuf *out, const char *prefix)
+ struct strbuf *out, const char *prefix)
{
- if (len > 0)
- strbuf_grow(out, len);
- strbuf_setlen(out, 0);
+ if (len < 0)
+ len = strlen(in);
+ strbuf_grow(out, len);
+ strbuf_setlen(out, 0);
if (prefix) {
int off = 0;
while (prefix[off] && off < len && prefix[off] == in[off])
@@ -104,7 +105,7 @@ static char *quote_path(const char *in, int len,
strbuf_addstr(out, "../");
}
- for (; (len < 0 && *in) || len > 0; in++, len--) {
+ for ( ; len > 0; in++, len--) {
int ch = *in;
switch (ch) {