summaryrefslogtreecommitdiffstats
path: root/usr.bin/patch
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2014-12-16 21:05:28 +0000
committerpfg <pfg@FreeBSD.org>2014-12-16 21:05:28 +0000
commit8631101d5aaad1393a949c1725cee5710626c49f (patch)
tree73e0a4ab3994fced9f7528f408167c4641883468 /usr.bin/patch
parentadf7828a9b948e87daf3f14ae61efd94f9024286 (diff)
downloadFreeBSD-src-8631101d5aaad1393a949c1725cee5710626c49f.zip
FreeBSD-src-8631101d5aaad1393a949c1725cee5710626c49f.tar.gz
MFC r275531, r275581, r275582;
patch(1): Small changes to sync with OpenBSD Update OpenBSD CVS revision tag for our r255232. Prefer setvbuf() to setlinebuf(). Small space changes, mostly to keep in sync with OpenBSD Obtained from: OpenBSD
Diffstat (limited to 'usr.bin/patch')
-rw-r--r--usr.bin/patch/patch.c6
-rw-r--r--usr.bin/patch/pch.c19
2 files changed, 14 insertions, 11 deletions
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index 85daf7f..14aca68 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -23,7 +23,7 @@
* -C option added in 1998, original code by Marc Espie, based on FreeBSD
* behaviour
*
- * $OpenBSD: patch.c,v 1.50 2012/05/15 19:32:02 millert Exp $
+ * $OpenBSD: patch.c,v 1.52 2014/11/26 18:34:51 millert Exp $
* $FreeBSD$
*
*/
@@ -150,8 +150,8 @@ main(int argc, char *argv[])
const char *tmpdir;
char *v;
- setlinebuf(stdout);
- setlinebuf(stderr);
+ setvbuf(stdout, NULL, _IOLBF, 0);
+ setvbuf(stderr, NULL, _IOLBF, 0);
for (i = 0; i < MAXFILEC; i++)
filearg[i] = NULL;
diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c
index d9c4b3d..8c14092 100644
--- a/usr.bin/patch/pch.c
+++ b/usr.bin/patch/pch.c
@@ -24,7 +24,7 @@
* -C option added in 1998, original code by Marc Espie, based on FreeBSD
* behaviour
*
- * $OpenBSD: pch.c,v 1.39 2012/04/11 08:07:13 ajacoutot Exp $
+ * $OpenBSD: pch.c,v 1.43 2014/11/18 17:03:35 tobias Exp $
* $FreeBSD$
*/
@@ -318,7 +318,8 @@ intuit_diff_type(void)
for (t = s + 7; isspace((unsigned char)*t); t++)
;
revision = savestr(t);
- for (t = revision; *t && !isspace((unsigned char)*t); t++)
+ for (t = revision;
+ *t && !isspace((unsigned char)*t); t++)
;
*t = '\0';
if (*revision == '\0') {
@@ -583,7 +584,8 @@ another_hunk(void)
p_end--;
return false;
}
- for (s = buf; *s && !isdigit((unsigned char)*s); s++)
+ for (s = buf;
+ *s && !isdigit((unsigned char)*s); s++)
;
if (!*s)
malformed();
@@ -593,7 +595,8 @@ another_hunk(void)
while (isdigit((unsigned char)*s))
s++;
if (*s == ',') {
- for (; *s && !isdigit((unsigned char)*s); s++)
+ for (;
+ *s && !isdigit((unsigned char)*s); s++)
;
if (!*s)
malformed();
@@ -690,8 +693,8 @@ another_hunk(void)
change_line:
if (buf[1] == '\n' && canonicalize)
strlcpy(buf + 1, " \n", buf_size - 1);
- if (!isspace((unsigned char)buf[1]) && buf[1] != '>' &&
- buf[1] != '<' &&
+ if (!isspace((unsigned char)buf[1]) &&
+ buf[1] != '>' && buf[1] != '<' &&
repl_beginning && repl_could_be_missing) {
repl_missing = true;
goto hunk_done;
@@ -1420,8 +1423,8 @@ do_ed_script(void)
for (t = buf; isdigit((unsigned char)*t) || *t == ','; t++)
;
/* POSIX defines allowed commands as {a,c,d,i,s} */
- if (isdigit((unsigned char)*buf) && (*t == 'a' || *t == 'c' ||
- *t == 'd' || *t == 'i' || *t == 's')) {
+ if (isdigit((unsigned char)*buf) &&
+ (*t == 'a' || *t == 'c' || *t == 'd' || *t == 'i' || *t == 's')) {
if (pipefp != NULL)
fputs(buf, pipefp);
if (*t != 'd') {
OpenPOWER on IntegriCloud