summaryrefslogtreecommitdiff
path: root/usr.bin/patch/patch.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>1998-11-06 22:40:13 +0000
committerchristos <christos@NetBSD.org>1998-11-06 22:40:13 +0000
commitb239b35fe21bc19fd8c574440349afc36e0340db (patch)
treef89ebe58d2e7700b00b44d9eed92701ad337d78e /usr.bin/patch/patch.c
parent1a67b18deb29f5d55aff0556838a7216171908a8 (diff)
char -> unsigned char
rindex -> strrchr
Diffstat (limited to 'usr.bin/patch/patch.c')
-rw-r--r--usr.bin/patch/patch.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index b069a9441b1..5b828478a5e 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -1,4 +1,4 @@
-/* $NetBSD: patch.c,v 1.6 1998/02/22 13:33:49 christos Exp $ */
+/* $NetBSD: patch.c,v 1.7 1998/11/06 22:40:13 christos Exp $ */
/* patch - a program to apply diffs to original files
*
@@ -10,7 +10,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: patch.c,v 1.6 1998/02/22 13:33:49 christos Exp $");
+__RCSID("$NetBSD: patch.c,v 1.7 1998/11/06 22:40:13 christos Exp $");
#endif /* not lint */
#include "INTERN.h"
@@ -308,7 +308,7 @@ char **argv;
Strcpy(rejname, outname);
#ifndef FLEXFILENAMES
{
- char *s = rindex(rejname,'/');
+ char *s = strrchr(rejname,'/');
if (!s)
s = rejname;
@@ -498,7 +498,7 @@ get_some_switches()
do_defines = TRUE;
if (!*++s)
s = nextarg();
- if (!isalpha(*s) && '_' != *s)
+ if (!isalpha((unsigned char)*s) && '_' != *s)
fatal1("argument to -D is not an identifier\n");
Sprintf(if_defined, "#ifdef %s\n", s);
Sprintf(not_defined, "#ifndef %s\n", s);
@@ -894,12 +894,12 @@ Reg2 char *b;
Reg3 int len;
{
while (len) {
- if (isspace(*b)) { /* whitespace (or \n) to match? */
- if (!isspace(*a)) /* no corresponding whitespace? */
+ if (isspace((unsigned char)*b)) {/* whitespace (or \n) to match? */
+ if (!isspace((unsigned char)*a))/* no corresponding whitespace? */
return FALSE;
- while (len && isspace(*b) && *b != '\n')
+ while (len && isspace((unsigned char)*b) && *b != '\n')
b++,len--; /* skip pattern whitespace */
- while (isspace(*a) && *a != '\n')
+ while (isspace((unsigned char)*a) && *a != '\n')
a++; /* skip target whitespace */
if (*a == '\n' || *b == '\n')
return (*a == *b); /* should end in sync */