]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-blob.c
ui-blob: don't segfault when no path is given
[ps-cgit] / ui-blob.c
index c59fbcb2a70669ed9897ba61d81efeea082a8690..7aec0b17c8124eeff685aa4be1b3ea55884b5f17 100644 (file)
--- a/ui-blob.c
+++ b/ui-blob.c
@@ -80,7 +80,7 @@ void cgit_print_blob(const char *hex, char *path, const char *head)
        struct commit *commit;
        struct pathspec_item path_items = {
                .match = path,
-               .len = strlen(path)
+               .len = path ? strlen(path) : 0
        };
        struct pathspec paths = {
                .nr = 1,