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
This commit is contained in:
parent
55e1a05578
commit
5e30934038
@ -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 <bsd.prog.mk>
|
||||
|
@ -52,6 +52,7 @@ char *alloca ();
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* 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
|
||||
|
@ -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.
|
||||
|
@ -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. */
|
||||
|
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user