]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-snapshot.c
ui-snapshot.c: specify archiver_args.baselen
[ps-cgit] / ui-snapshot.c
index 966a14007414f35d0e04f862a593c93ba26421b5..7a597ff00879a76adab38ed351c2f3dadc7ed4a0 100644 (file)
@@ -82,7 +82,13 @@ static int make_snapshot(const struct cgit_snapshot_format *format,
                return 1;
        }
        memset(&args, 0, sizeof(args));
-       args.base = fmt("%s/", prefix);
+       if (prefix) {
+               args.base = fmt("%s/", prefix);
+               args.baselen = strlen(prefix) + 1;
+       } else {
+               args.base = "";
+               args.baselen = 0;
+       }
        args.tree = commit->tree;
        args.time = commit->date;
        ctx.page.mimetype = xstrdup(format->mimetype);