]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-blob.c
ui-refs.c: Refactor print_tag()
[ps-cgit] / ui-blob.c
index c59fbcb2a70669ed9897ba61d81efeea082a8690..1da43c81519927f99b7f67a8c08d7df0eee34359 100644 (file)
--- a/ui-blob.c
+++ b/ui-blob.c
@@ -8,6 +8,7 @@
  */
 
 #include "cgit.h"
+#include "ui-blob.h"
 #include "html.h"
 #include "ui-shared.h"
 
@@ -80,7 +81,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,