]> git.armaanb.net Git - stagit.git/blobdiff - stagit-index.c
stagit-index: remove empty h1 and add bold markup to table headers
[stagit.git] / stagit-index.c
index 1834d8db5e2775b475928dad5b5946dd1b19ee10..1552f40bd9159ed192c20a8d7bc7224f6194f389 100644 (file)
 static git_repository *repo;
 
 static const char *relpath = "";
-static const char *repodir;
 
 static char description[255] = "Repositories";
 static char *name = "";
 static char owner[255];
 
 #ifndef USE_PLEDGE
-int
-pledge(const char *promises, const char *paths[])
-{
-        return 0;
-}
+#define pledge(p1,p2) 0
 #endif
 
 void
@@ -52,7 +47,7 @@ xmlencode(FILE *fp, const char *s, size_t len)
                switch(*s) {
                case '<':  fputs("&lt;",   fp); break;
                case '>':  fputs("&gt;",   fp); break;
-               case '\'': fputs("&apos;", fp); break;
+               case '\'': fputs("&#39;" , fp); break;
                case '&':  fputs("&amp;",  fp); break;
                case '"':  fputs("&quot;", fp); break;
                default:   fputc(*s, fp);
@@ -86,12 +81,14 @@ writeheader(FILE *fp)
        fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\" />\n", relpath);
        fputs("</head>\n<body>\n", fp);
        fprintf(fp, "<table>\n<tr><td><img src=\"%slogo.png\" alt=\"\" width=\"32\" height=\"32\" /></td>\n"
-               "<td><h1>%s</h1><span class=\"desc\">%s</span></td></tr><tr><td></td><td>\n",
-               relpath, name, description);
-       fputs("</td></tr>\n</table>\n<hr/>\n<div id=\"content\">\n"
-             "<table id=\"index\"><thead>\n"
-             "<tr><td>Name</td><td>Description</td><td>Owner</td><td>Last commit</td></tr>"
-             "</thead><tbody>\n", fp);
+               "<td><span class=\"desc\">", relpath);
+       xmlencode(fp, description, strlen(description));
+       fputs("</span></td></tr><tr><td></td><td>\n"
+               "</td></tr>\n</table>\n<hr/>\n<div id=\"content\">\n"
+               "<table id=\"index\"><thead>\n"
+               "<tr><td><b>Name</b></td><td><b>Description</b></td><td><b>Owner</b></td>"
+               "<td><b>Last commit</b></td></tr>"
+               "</thead><tbody>\n", fp);
 }
 
 void
@@ -157,6 +154,7 @@ main(int argc, char *argv[])
        const git_error *e = NULL;
        FILE *fp;
        char path[PATH_MAX], repodirabs[PATH_MAX + 1];
+       const char *repodir;
        int i, ret = 0;
 
        if (pledge("stdio rpath", NULL) == -1)