From: Tim Kientzle Date: Sat, 24 May 2008 21:19:02 +0000 (-0400) Subject: Enable the new -s substitution support on FreeBSD, include X-Git-Tag: v2.6.0~201 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2664247853a3152384fffae5e35e3b1911add767;p=thirdparty%2Flibarchive.git Enable the new -s substitution support on FreeBSD, include the new source file, and fix a minor compiler warning in the substitution code. SVN-Revision: 91 --- diff --git a/tar/Makefile b/tar/Makefile index b6a6a7768..57888f269 100644 --- a/tar/Makefile +++ b/tar/Makefile @@ -2,7 +2,7 @@ PROG= bsdtar BSDTAR_VERSION_STRING=2.5.3b -SRCS= bsdtar.c getdate.y matching.c read.c siginfo.c tree.c util.c write.c +SRCS= bsdtar.c getdate.y matching.c read.c siginfo.c subst.c tree.c util.c write.c WARNS?= 5 DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} LDADD= -larchive -lbz2 -lz diff --git a/tar/config_freebsd.h b/tar/config_freebsd.h index 8704f05ca..52737c41e 100644 --- a/tar/config_freebsd.h +++ b/tar/config_freebsd.h @@ -77,6 +77,7 @@ #endif #define HAVE_PATHS_H 1 #define HAVE_PWD_H 1 +#define HAVE_REGEX_H 1 #define HAVE_SETLOCALE 1 #define HAVE_STDARG_H 1 #define HAVE_STDINT_H 1 diff --git a/tar/subst.c b/tar/subst.c index 2233a21e1..9fcd4d95f 100644 --- a/tar/subst.c +++ b/tar/subst.c @@ -224,7 +224,7 @@ apply_substitution(struct bsdtar *bsdtar, const char *name, char **result, int s break; case '1' ... '9': realloc_strncat(bsdtar, result, rule->result + j, i - j - 1); - if (c - '0' > rule->re.re_nsub) { + if ((size_t)(c - '0') > (size_t)(rule->re.re_nsub)) { free(*result); *result = NULL; return -1;