]> gitweb.ps.run Git - ps-cgit/blobdiff - parsing.c
cgit.c: fix whitespace breakage
[ps-cgit] / parsing.c
index 8aad1dd39ee531713a19fb902dbcacf2a77ccfa9..332d61c50b47329347fc463f4159f8cbca4fc401 100644 (file)
--- a/parsing.c
+++ b/parsing.c
@@ -201,13 +201,13 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
 struct taginfo *cgit_parse_tag(struct tag *tag)
 {
        void *data;
-       char type[20];
+       enum object_type type;
        unsigned long size;
        char *p, *t;
        struct taginfo *ret;
 
-       data = read_sha1_file(tag->object.sha1, type, &size);
-       if (!data || strcmp(type, tag_type)) {
+       data = read_sha1_file(tag->object.sha1, &type, &size);
+       if (!data || type != OBJ_TAG) {
                free(data);
                return 0;
        }
@@ -220,7 +220,7 @@ struct taginfo *cgit_parse_tag(struct tag *tag)
 
        p = data;
 
-       while (p) {
+       while (p && *p) {
                if (*p == '\n')
                        break;
 
@@ -238,7 +238,7 @@ struct taginfo *cgit_parse_tag(struct tag *tag)
 
        while (p && (*p == '\n'))
                p = strchr(p, '\n') + 1;
-       if (p)
+       if (p && *p)
                ret->msg = xstrdup(p);
        free(data);
        return ret;