X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=builtin-tar-tree.c;h=7663b9bd8e5f10ee45e34752f631d435687cf1b3;hb=7612a1efdb0c0806b43db10ce784707aae874340;hp=5f740cf7025bc2a9b46656332c6a54e78ee737e4;hpb=7fb23e6083dbefa8eb4c554d8b2cd5a6292b2df4;p=git.git diff --git a/builtin-tar-tree.c b/builtin-tar-tree.c index 5f740cf7..7663b9bd 100644 --- a/builtin-tar-tree.c +++ b/builtin-tar-tree.c @@ -168,8 +168,9 @@ static int get_path_prefix(const struct strbuf *path, int maxlen) int i = path->len; if (i > maxlen) i = maxlen; - while (i > 0 && path->buf[i] != '/') + do { i--; + } while (i > 0 && path->buf[i] != '/'); return i; }