summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnand Kumria <wildfire@progsoc.org>2006-06-10 23:17:29 +0200
committerYann Dirson <ydirson@altern.org>2006-06-13 09:32:58 +0200
commit37f08ffbfeeea2b2b5b457b85e023b314a6006ef (patch)
tree2af40d74cd7cc6e0cfcc28901644ce8a957f3a56
parent4e3aa38681c849d6931dd56d958fff6abf3ea38e (diff)
downloadcvsps-37f08ffbfeeea2b2b5b457b85e023b314a6006ef.tar.gz
FreeBSD isn't evil - just misguided
cvsps fails against a FreeBSD CVS pserver. By fails I mean it fails back to using the 'log' command rather the 'rlog' which would give me stable patchsets. cvsps requires the remote pserver to be 1.11.1 or later for rlog to work and, indeed, the other side is a later version. Unfortunately FreeBSD have, misguidedly, modified the version string such that cvsps misdetects things.
-rw-r--r--cap.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/cap.c b/cap.c
index a6186f6..a1927df 100644
--- a/cap.c
+++ b/cap.c
@@ -121,11 +121,19 @@ int check_version_string(const char * str, int req_major, int req_minor, int req
return 0;
}
+ /* We might have encountered a FreeBSD system which
+ * has a mucked up version string of:
+ * Concurrent Versions System (CVS) '1.11.17'-FreeBSD (client/server)
+ * so re-test just in case
+ */
p += skip;
if (sscanf(p, "%d.%d.%d", &major, &minor, &extra) != 3)
{
- debug(DEBUG_APPMSG1, "WARNING: malformed CVS version: %s", str);
- return 0;
+ if (sscanf(p, "'%d.%d.%d'", &major, &minor, &extra) != 3)
+ {
+ debug(DEBUG_APPMSG1, "WARNING: malformed CVS version: %s", str);
+ return 0;
+ }
}
return (major > req_major ||