]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-snapshot.c
Use GIT-1.6.0.2
[ps-cgit] / ui-snapshot.c
index 512fcd2f069456f8c55ee30779995c68a3a7e552..7a597ff00879a76adab38ed351c2f3dadc7ed4a0 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "cgit.h"
 #include "html.h"
 
 #include "cgit.h"
 #include "html.h"
+#include "ui-shared.h"
 
 static int write_compressed_tar_archive(struct archiver_args *args,const char *filter)
 {
 
 static int write_compressed_tar_archive(struct archiver_args *args,const char *filter)
 {
@@ -81,7 +82,13 @@ static int make_snapshot(const struct cgit_snapshot_format *format,
                return 1;
        }
        memset(&args, 0, sizeof(args));
                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);
        args.tree = commit->tree;
        args.time = commit->date;
        ctx.page.mimetype = xstrdup(format->mimetype);