]> gitweb.ps.run Git - ps-cgit/commitdiff
ui-shared: use placeholder for empty commit subject
authorChristian Franke <nobody@nowhere.ws>
Sun, 28 Oct 2012 17:36:08 +0000 (18:36 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sun, 28 Oct 2012 17:53:58 +0000 (11:53 -0600)
Display a placeholder when creating links to commits with empty subjects.
This avoids the creation of links of the form <a></a>.

ui-shared.c

index d9d5da74ac14ddb2e01772571e461dfae36c0844..75b97a1ec7b8f5c98701a35431871800ccfb45cb 100644 (file)
@@ -361,7 +361,10 @@ void cgit_commit_link(char *name, const char *title, const char *class,
                delim = "&amp;";
        }
        html("'>");
-       html_txt(name);
+       if (name[0] != '\0')
+               html_txt(name);
+       else
+               html_txt("(no commit message)");
        html("</a>");
 }