=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/patch/patch.c,v retrieving revision 1.50 retrieving revision 1.51 diff -c -r1.50 -r1.51 *** src/usr.bin/patch/patch.c 2012/05/15 19:32:02 1.50 --- src/usr.bin/patch/patch.c 2013/11/26 13:19:07 1.51 *************** *** 1,4 **** ! /* $OpenBSD: patch.c,v 1.50 2012/05/15 19:32:02 millert Exp $ */ /* * patch - a program to apply diffs to original files --- 1,4 ---- ! /* $OpenBSD: patch.c,v 1.51 2013/11/26 13:19:07 deraadt Exp $ */ /* * patch - a program to apply diffs to original files *************** *** 508,514 **** break; case 'D': do_defines = true; ! if (!isalpha(*optarg) && *optarg != '_') fatal("argument to -D is not an identifier\n"); snprintf(if_defined, sizeof if_defined, "#ifdef %s\n", optarg); --- 508,514 ---- break; case 'D': do_defines = true; ! if (!isalpha((unsigned char)*optarg) && *optarg != '_') fatal("argument to -D is not an identifier\n"); snprintf(if_defined, sizeof if_defined, "#ifdef %s\n", optarg); *************** *** 1030,1041 **** similar(const char *a, const char *b, int len) { while (len) { ! if (isspace(*b)) { /* whitespace (or \n) to match? */ ! if (!isspace(*a)) /* no corresponding whitespace? */ ! return false; ! while (len && isspace(*b) && *b != '\n') b++, len--; /* skip pattern whitespace */ ! while (isspace(*a) && *a != '\n') a++; /* skip target whitespace */ if (*a == '\n' || *b == '\n') return (*a == *b); /* should end in sync */ --- 1030,1041 ---- similar(const char *a, const char *b, int len) { while (len) { ! if (isspace((unsigned char)*b)) { /* whitespace (or \n) to match? */ ! if (!isspace((unsigned char)*a)) ! return false; /* no corresponding whitespace */ ! while (len && isspace((unsigned char)*b) && *b != '\n') b++, len--; /* skip pattern whitespace */ ! while (isspace((unsigned char)*a) && *a != '\n') a++; /* skip target whitespace */ if (*a == '\n' || *b == '\n') return (*a == *b); /* should end in sync */