]> git.armaanb.net Git - stagit.git/blobdiff - stagit.c
simplify range check
[stagit.git] / stagit.c
index 06c213ce1be7fcaad7438c207fbdbe397a1d025f..6598ddd2cc0523f918db6c87a01795ced9ee51d9 100644 (file)
--- a/stagit.c
+++ b/stagit.c
@@ -65,10 +65,6 @@ static char lastoidstr[GIT_OID_HEXSZ + 2]; /* id + newline + nul byte */
 static FILE *rcachefp, *wcachefp;
 static const char *cachefile;
 
-#ifndef USE_PLEDGE
-#define pledge(p1,p2) 0
-#endif
-
 void
 joinpath(char *buf, size_t bufsiz, const char *path, const char *path2)
 {
@@ -606,6 +602,10 @@ writelog(FILE *fp, const git_oid *oid)
                } else if (nlogcommits > 0) {
                        writelogline(fp, ci);
                        nlogcommits--;
+                       if (!nlogcommits && ci->parentoid[0])
+                               fputs("<tr><td></td><td colspan=\"5\">"
+                                     "More commits remaining [...]</td>"
+                                     "</tr>\n", fp);
                }
 
                if (cachefile)
@@ -1042,10 +1042,7 @@ main(int argc, char *argv[])
                        errno = 0;
                        nlogcommits = strtoll(argv[++i], &p, 10);
                        if (argv[i][0] == '\0' || *p != '\0' ||
-                           nlogcommits <= 0)
-                               usage(argv[0]);
-                       if (errno == ERANGE && (nlogcommits == LLONG_MAX ||
-                           nlogcommits == LLONG_MIN))
+                           nlogcommits <= 0 || errno)
                                usage(argv[0]);
                }
        }
@@ -1057,6 +1054,7 @@ main(int argc, char *argv[])
 
        git_libgit2_init();
 
+#ifdef __OpenBSD__
        if (cachefile) {
                if (pledge("stdio rpath wpath cpath fattr", NULL) == -1)
                        err(1, "pledge");
@@ -1064,6 +1062,7 @@ main(int argc, char *argv[])
                if (pledge("stdio rpath wpath cpath", NULL) == -1)
                        err(1, "pledge");
        }
+#endif
 
        if (git_repository_open_ext(&repo, repodir,
                GIT_REPOSITORY_OPEN_NO_SEARCH, NULL) < 0) {