From 5a9515e41823c0301caeed698dac85c7fb2517a4 Mon Sep 17 00:00:00 2001 From: jmg Date: Mon, 17 Mar 1997 01:44:43 +0000 Subject: fix compilation warnings in patch... (with slight modification) also remove -Wall that I acidentally committed last time I was here... Submitted-by: Philippe Charnier Closes PR#2998 --- gnu/usr.bin/patch/Makefile | 2 +- gnu/usr.bin/patch/getopt.c | 1 + gnu/usr.bin/patch/inp.c | 17 +++++++++++++++-- gnu/usr.bin/patch/patch.c | 16 +++++++++++++++- gnu/usr.bin/patch/util.c | 4 ++-- 5 files changed, 34 insertions(+), 6 deletions(-) (limited to 'gnu/usr.bin/patch') diff --git a/gnu/usr.bin/patch/Makefile b/gnu/usr.bin/patch/Makefile index d16f628..4d5fad2 100644 --- a/gnu/usr.bin/patch/Makefile +++ b/gnu/usr.bin/patch/Makefile @@ -1,6 +1,6 @@ PROG= patch SRCS = backupfile.c getopt.c getopt1.c inp.c patch.c pch.c util.c \ version.c -CFLAGS += -DHAVE_CONFIG_H -Wall +CFLAGS += -DHAVE_CONFIG_H MAN= patch.1 .include diff --git a/gnu/usr.bin/patch/getopt.c b/gnu/usr.bin/patch/getopt.c index a59a013..98a6f33 100644 --- a/gnu/usr.bin/patch/getopt.c +++ b/gnu/usr.bin/patch/getopt.c @@ -52,6 +52,7 @@ char *alloca (); #endif #include +#include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C diff --git a/gnu/usr.bin/patch/inp.c b/gnu/usr.bin/patch/inp.c index 7b78651..0f8e882 100644 --- a/gnu/usr.bin/patch/inp.c +++ b/gnu/usr.bin/patch/inp.c @@ -1,6 +1,19 @@ -/* $Header: /usr/cvs/src/gnu/usr.bin/patch/inp.c,v 1.3 1995/05/30 05:02:31 rgrimes Exp $ +/* $Header: /home/ncvs/src/gnu/usr.bin/patch/inp.c,v 1.4 1997/02/13 21:10:39 jmg Exp $ * * $Log: inp.c,v $ + * Revision 1.4 1997/02/13 21:10:39 jmg + * Fix a problem with patch in that is will always default, even when the + * controlling terminal is closed. Now the function ask() will return 1 when th + * input is known to come from a file or terminal, or it will return 0 when ther + * was a read error. + * + * Modified the question "Skip patch?" so that on an error from ask it will skip + * the patch instead of looping. + * + * Closes PR#777 + * + * 2.2 candidate + * * Revision 1.3 1995/05/30 05:02:31 rgrimes * Remove trailing whitespace. * @@ -129,7 +142,7 @@ char *filename; #define try(f,a1,a2) (Sprintf(s + pathlen, f, a1, a2), stat(s, &cstat) == 0) if (( try("RCS/%s%s", filebase, RCSSUFFIX) - || try("RCS/%s" , filebase, 0) + || try("RCS/%s%s", filebase, "") || try( "%s%s", filebase, RCSSUFFIX)) && /* Check that RCS file is not working file. diff --git a/gnu/usr.bin/patch/patch.c b/gnu/usr.bin/patch/patch.c index 2329ec8..9a29178 100644 --- a/gnu/usr.bin/patch/patch.c +++ b/gnu/usr.bin/patch/patch.c @@ -1,5 +1,5 @@ char rcsid[] = - "$Header: /usr/cvs/src/gnu/usr.bin/patch/patch.c,v 1.6 1995/05/30 05:02:34 rgrimes Exp $"; + "$Header: /home/ncvs/src/gnu/usr.bin/patch/patch.c,v 1.7 1997/02/13 21:10:41 jmg Exp $"; /* patch - a program to apply diffs to original files * @@ -9,6 +9,19 @@ char rcsid[] = * money off of it, or pretend that you wrote it. * * $Log: patch.c,v $ + * Revision 1.7 1997/02/13 21:10:41 jmg + * Fix a problem with patch in that is will always default, even when the + * controlling terminal is closed. Now the function ask() will return 1 when th + * input is known to come from a file or terminal, or it will return 0 when ther + * was a read error. + * + * Modified the question "Skip patch?" so that on an error from ask it will skip + * the patch instead of looping. + * + * Closes PR#777 + * + * 2.2 candidate + * * Revision 1.6 1995/05/30 05:02:34 rgrimes * Remove trailing whitespace. * @@ -417,6 +430,7 @@ char **argv; set_signals(1); } my_exit(failtotal); + return (failtotal); } /* Prepare to find the next patch to do in the patch file. */ diff --git a/gnu/usr.bin/patch/util.c b/gnu/usr.bin/patch/util.c index 6c00880..6ab6ecf 100644 --- a/gnu/usr.bin/patch/util.c +++ b/gnu/usr.bin/patch/util.c @@ -169,7 +169,7 @@ Reg1 char *s; } else { t = rv; - while (*t++ = *s++); + while ((*t++ = *s++)); } return rv; } @@ -417,7 +417,7 @@ int assume_exists; #define try(f, a1, a2) (Sprintf(tmpbuf + pathlen, f, a1, a2), stat(tmpbuf, &filestat) == 0) if ( try("RCS/%s%s", filebase, RCSSUFFIX) - || try("RCS/%s" , filebase, 0) + || try("RCS/%s%s", filebase, "") || try( "%s%s", filebase, RCSSUFFIX) || try("SCCS/%s%s", SCCSPREFIX, filebase) || try( "%s%s", SCCSPREFIX, filebase)) -- cgit v1.1