]> git.armaanb.net Git - stagit.git/blobdiff - src/stagit.c
micro-optimization: fputc (function) -> putc (macro/inline function)
[stagit.git] / src / stagit.c
index bdf2f70fe64568bd4845b0fdbf76dee2d69b4219..93127ef9bb9dacbdbbf2508a1ea6d597058c68fa 100644 (file)
@@ -334,8 +334,11 @@ xmlencodeline(FILE *fp, const char *s, size_t len)
                case '\'': fputs("'",  fp); break;
                case '&':  fputs("&",  fp); break;
                case '"':  fputs(""", fp); break;
+<<<<<<< HEAD:src/stagit.c
                case '\r': break; /* ignore CR */
                case '\n': break; /* ignore LF */
+=======
+>>>>>>> 722f836 (micro-optimization: fputc (function) -> putc (macro/inline function)):stagit.c
                default:   putc(*s, fp);
                }
        }
@@ -554,12 +557,12 @@ printcommit(FILE *fp, struct commitinfo *ci)
                xmlencode(fp, ci->author->email, strlen(ci->author->email));
                fputs("</a>&gt;\n<b>Date:</b>   ", fp);
                printtime(fp, &(ci->author->when));
-               fputc('\n', fp);
+               putc('\n', fp);
        }
        if (ci->msg) {
-               fputc('\n', fp);
+               putc('\n', fp);
                xmlencode(fp, ci->msg, strlen(ci->msg));
-               fputc('\n', fp);
+               putc('\n', fp);
        }
 }
 
@@ -827,10 +830,10 @@ printcommitatom(FILE *fp, struct commitinfo *ci)
                xmlencode(fp, ci->author->email, strlen(ci->author->email));
                fputs("&gt;\nDate:   ", fp);
                printtime(fp, &(ci->author->when));
-               fputc('\n', fp);
+               putc('\n', fp);
        }
        if (ci->msg) {
-               fputc('\n', fp);
+               putc('\n', fp);
                xmlencode(fp, ci->msg, strlen(ci->msg));
        }
        fputs("\n</content>\n</entry>\n", fp);
@@ -1195,7 +1198,8 @@ err:
 void
 usage(char *argv0)
 {
-       fprintf(stderr, "%s [-c cachefile | -l commits] repodir\n", argv0);
+       fprintf(stderr, "%s [-c cachefile | -l commits] "
+               "[-u baseurl] repodir\n", argv0);
        exit(1);
 }
 
@@ -1228,6 +1232,10 @@ main(int argc, char *argv[])
                        if (argv[i][0] == '\0' || *p != '\0' ||
                            nlogcommits <= 0 || errno)
                                usage(argv[0]);
+               } else if (argv[i][1] == 'u') {
+                       if (i + 1 >= argc)
+                               usage(argv[0]);
+                       baseurl = argv[++i];
                }
        }
        if (!repodir)
@@ -1255,9 +1263,6 @@ main(int argc, char *argv[])
        }
 #endif
 
-       if ((p = getenv("STAGIT_BASEURL")))
-               baseurl = p;
-
        if (git_repository_open_ext(&repo, repodir,
                GIT_REPOSITORY_OPEN_NO_SEARCH, NULL) < 0) {
                fprintf(stderr, "%s: cannot open repository\n", argv[0]);