diff options
author | Ross Lagerwall <rosslagerwall@gmail.com> | 2013-09-16 08:39:02 +0200 |
---|---|---|
committer | Ross Lagerwall <rosslagerwall@gmail.com> | 2013-09-16 08:39:02 +0200 |
commit | efa2eb44a90321d26809e0976d0b6834599be415 (patch) | |
tree | 723eed61afa3d49d341ee578add0e17507ccab6c /cpio/test | |
parent | 2c1bfdf1b3cab891b6c8ed28dac593ac77813e93 (diff) | |
download | libarchive-efa2eb44a90321d26809e0976d0b6834599be415.tar.gz |
Show third party library versions in version string
Add a utility function, archive_version_details, to return a string
containing the libarchive version as well as the versions of third party
libraries such as zlib, bz2lib and liblzma. Use this function for
bsdtar --version and bsdcpio --version.
http://code.google.com/p/libarchive/issues/detail?id=118
Diffstat (limited to 'cpio/test')
-rw-r--r-- | cpio/test/test.h | 1 | ||||
-rw-r--r-- | cpio/test/test_option_version.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/cpio/test/test.h b/cpio/test/test.h index 666bba0e..27813e1e 100644 --- a/cpio/test/test.h +++ b/cpio/test/test.h @@ -66,6 +66,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <ctype.h> #include <time.h> #ifdef HAVE_UNISTD_H #include <unistd.h> diff --git a/cpio/test/test_option_version.c b/cpio/test/test_option_version.c index 7345da1e..2f2c4090 100644 --- a/cpio/test/test_option_version.c +++ b/cpio/test/test_option_version.c @@ -74,6 +74,11 @@ verify(const char *p, size_t s) /* Skip a single trailing a,b,c, or d. */ if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') ++q; + /* Skip arbitrary third-party version numbers. */ + while (s > 0 && (*q == ' ' || *q == '/' || *q == '.' || isalnum(*q))) { + ++q; + --s; + } /* All terminated by end-of-line: \r, \r\n, or \n */ assert(s >= 1); failure("Version: %s", p); |