t: use nongit() function where applicable
[gitweb.git] / path.c
diff --git a/path.c b/path.c
index a8e72955f6f28f6e27e7faeee144f4f3ed492c83..52d889c88ea8483b7a78937804bb1b789d2daa1e 100644 (file)
--- a/path.c
+++ b/path.c
@@ -25,7 +25,8 @@ static struct strbuf *get_pathname(void)
                STRBUF_INIT, STRBUF_INIT, STRBUF_INIT, STRBUF_INIT
        };
        static int index;
-       struct strbuf *sb = &pathname_array[3 & ++index];
+       struct strbuf *sb = &pathname_array[index];
+       index = (index + 1) % ARRAY_SIZE(pathname_array);
        strbuf_reset(sb);
        return sb;
 }