summaryrefslogtreecommitdiffstats
path: root/bin/pax/pat_rep.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pax/pat_rep.c')
-rw-r--r--bin/pax/pat_rep.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c
index e68a0eb..d6ecd53 100644
--- a/bin/pax/pat_rep.c
+++ b/bin/pax/pat_rep.c
@@ -98,7 +98,7 @@ static int resub __P((regex_t *, regmatch_t *, char *, char *, char *));
* the list of replacement patterns; -1 otherwise.
*/
-#if __STDC__
+#ifdef __STDC__
int
rep_add(register char *str)
#else
@@ -119,7 +119,7 @@ rep_add(str)
* throw out the bad parameters
*/
if ((str == NULL) || (*str == '\0')) {
- pax_warn(1, "Empty replacement string");
+ paxwarn(1, "Empty replacement string");
return(-1);
}
@@ -128,7 +128,7 @@ rep_add(str)
* this expression
*/
if ((pt1 = strchr(str+1, *str)) == NULL) {
- pax_warn(1, "Invalid replacement string %s", str);
+ paxwarn(1, "Invalid replacement string %s", str);
return(-1);
}
@@ -137,7 +137,7 @@ rep_add(str)
* and split out the regular expression and try to compile it
*/
if ((rep = (REPLACE *)malloc(sizeof(REPLACE))) == NULL) {
- pax_warn(1, "Unable to allocate memory for replacement string");
+ paxwarn(1, "Unable to allocate memory for replacement string");
return(-1);
}
@@ -147,7 +147,7 @@ rep_add(str)
# else
if ((res = regcomp(&(rep->rcmp), str+1, 0)) != 0) {
regerror(res, &(rep->rcmp), rebuf, sizeof(rebuf));
- pax_warn(1, "%s while compiling regular expression %s", rebuf, str);
+ paxwarn(1, "%s while compiling regular expression %s", rebuf, str);
# endif
(void)free((char *)rep);
return(-1);
@@ -166,7 +166,7 @@ rep_add(str)
regfree(&(rep->rcmp));
# endif
(void)free((char *)rep);
- pax_warn(1, "Invalid replacement string %s", str);
+ paxwarn(1, "Invalid replacement string %s", str);
return(-1);
}
@@ -196,7 +196,7 @@ rep_add(str)
# endif
(void)free((char *)rep);
*pt1 = *str;
- pax_warn(1, "Invalid replacement string option %s", str);
+ paxwarn(1, "Invalid replacement string option %s", str);
return(-1);
}
++pt2;
@@ -226,7 +226,7 @@ rep_add(str)
* 0 if the pattern was added to the list, -1 otherwise
*/
-#if __STDC__
+#ifdef __STDC__
int
pat_add(char *str)
#else
@@ -241,7 +241,7 @@ pat_add(str)
* throw out the junk
*/
if ((str == NULL) || (*str == '\0')) {
- pax_warn(1, "Empty pattern string");
+ paxwarn(1, "Empty pattern string");
return(-1);
}
@@ -251,7 +251,7 @@ pat_add(str)
* node to the end of the pattern list
*/
if ((pt = (PATTERN *)malloc(sizeof(PATTERN))) == NULL) {
- pax_warn(1, "Unable to allocate memory for pattern string");
+ paxwarn(1, "Unable to allocate memory for pattern string");
return(-1);
}
@@ -275,7 +275,7 @@ pat_add(str)
* a selected archive member.
*/
-#if __STDC__
+#ifdef __STDC__
void
pat_chk(void)
#else
@@ -294,7 +294,7 @@ pat_chk()
if (pt->flgs & MTCH)
continue;
if (!wban) {
- pax_warn(1, "WARNING! These patterns were not matched:");
+ paxwarn(1, "WARNING! These patterns were not matched:");
++wban;
}
(void)fprintf(stderr, "%s\n", pt->pstr);
@@ -317,7 +317,7 @@ pat_chk()
* match, -1 otherwise.
*/
-#if __STDC__
+#ifdef __STDC__
int
pat_sel(register ARCHD *arcn)
#else
@@ -373,7 +373,7 @@ pat_sel(arcn)
*pt->pend = '\0';
if ((pt->pstr = strdup(arcn->name)) == NULL) {
- pax_warn(1, "Pattern select out of memory");
+ paxwarn(1, "Pattern select out of memory");
if (pt->pend != NULL)
*pt->pend = '/';
pt->pend = NULL;
@@ -421,7 +421,7 @@ pat_sel(arcn)
/*
* should never happen....
*/
- pax_warn(1, "Pattern list inconsistant");
+ paxwarn(1, "Pattern list inconsistant");
return(-1);
}
*ppt = pt->fow;
@@ -442,7 +442,7 @@ pat_sel(arcn)
* looking for more members)
*/
-#if __STDC__
+#ifdef __STDC__
int
pat_match(register ARCHD *arcn)
#else
@@ -520,7 +520,7 @@ pat_match(arcn)
* Note: *pend may be changed to show where the prefix ends.
*/
-#if __STDC__
+#ifdef __STDC__
static int
fn_match(register char *pattern, register char *string, char **pend)
#else
@@ -651,7 +651,7 @@ range_match(pattern, test)
* 0 continue to process file, 1 skip this file, -1 pax is finished
*/
-#if __STDC__
+#ifdef __STDC__
int
mod_name(register ARCHD *arcn)
#else
@@ -718,7 +718,7 @@ mod_name(arcn)
* 0 process this file, 1 skip this file, -1 we need to exit pax
*/
-#if __STDC__
+#ifdef __STDC__
static int
tty_rename(register ARCHD *arcn)
#else
@@ -790,7 +790,7 @@ tty_rename(arcn)
* 0 if ok, -1 if failure (name too long)
*/
-#if __STDC__
+#ifdef __STDC__
int
set_dest(register ARCHD *arcn, char *dest_dir, int dir_len)
#else
@@ -825,7 +825,7 @@ set_dest(arcn, dest_dir, dir_len)
* 0 if ok, -1 if the final name is too long
*/
-#if __STDC__
+#ifdef __STDC__
static int
fix_path( char *or_name, int *or_len, char *dir_name, int dir_len)
#else
@@ -856,7 +856,7 @@ fix_path(or_name, or_len, dir_name, dir_len)
--dest;
}
if ((len = dest - or_name) > PAXPATHLEN) {
- pax_warn(1, "File name %s/%s, too long", dir_name, start);
+ paxwarn(1, "File name %s/%s, too long", dir_name, start);
return(-1);
}
*or_len = len;
@@ -897,7 +897,7 @@ fix_path(or_name, or_len, dir_name, dir_len)
* ended up empty)
*/
-#if __STDC__
+#ifdef __STDC__
static int
rep_name(char *name, int *nlen, int prnt)
#else
@@ -983,7 +983,7 @@ rep_name(name, nlen, prnt)
< 0) {
# endif
if (prnt)
- pax_warn(1, "Replacement name error %s",
+ paxwarn(1, "Replacement name error %s",
name);
return(1);
}
@@ -1034,7 +1034,7 @@ rep_name(name, nlen, prnt)
*outpt = '\0';
if ((outpt == endpt) && (*inpt != '\0')) {
if (prnt)
- pax_warn(1,"Replacement name too long %s >> %s",
+ paxwarn(1,"Replacement name too long %s >> %s",
name, nname);
return(1);
}
@@ -1071,7 +1071,7 @@ rep_name(name, nlen, prnt)
* -1 if error, or the number of characters added to the destination.
*/
-#if __STDC__
+#ifdef __STDC__
static int
resub(regexp *prog, char *src, char *dest, register char *destend)
#else
@@ -1129,7 +1129,7 @@ resub(prog, src, dest, destend)
* -1 if error, or the number of characters added to the destination.
*/
-#if __STDC__
+#ifdef __STDC__
static int
resub(regex_t *rp, register regmatch_t *pm, char *src, char *dest,
register char *destend)
OpenPOWER on IntegriCloud