summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2010-05-04 09:35:35 -0600
committerAndreas Gruenbacher <agruen@suse.de>2010-05-04 18:36:56 +0200
commitbcf08ba04238ee7054e3f5d36066631459e2e0bc (patch)
tree65ad38a36ecb0a372801affce676c28053649a61
parent481768b9d7ac1adcf72f177f61372d34acec463f (diff)
downloadpatch-bcf08ba04238ee7054e3f5d36066631459e2e0bc.tar.gz
build: silence some cygwin warnings
* src/pch.c (includes): Add <io.h> for setmode. (intuit_diff_type): Avoid 8-bit problems. * src/util.c (parse_name): Likewise. * src/util.h (skip_spaces): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
-rw-r--r--ChangeLog11
-rw-r--r--src/pch.c5
-rw-r--r--src/util.c4
-rw-r--r--src/util.h2
4 files changed, 16 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 2a2d82f..e6a8fd3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-05-04 Eric Blake <eblake@redhat.com>
+
+ * src/pch.c (includes): Add <io.h> for setmode.
+ (intuit_diff_type): Avoid 8-bit problems.
+ * src/util.c (parse_name): Likewise.
+ * src/util.h (skip_spaces): Likewise.
+
2009-05-04 Andreas Gruenbacher <agruen@suse.de>
* src/util.c (create_backup): Document patch's backup file logic.
@@ -3448,13 +3455,13 @@ Sun Dec 17 17:29:48 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
Copyright (C) 1984, 1985, 1986, 1987, 1988 Larry Wall.
Copyright (C) 1989, 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001,
-2002, 2009 Free Software Foundation, Inc.
+2002, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Patch.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope that they will be useful,
diff --git a/src/pch.c b/src/pch.c
index 7e35e68..6a4941e 100644
--- a/src/pch.c
+++ b/src/pch.c
@@ -27,6 +27,9 @@
#undef XTERN
#define XTERN
#include <pch.h>
+#if HAVE_SETMODE_DOS
+# include <io.h>
+#endif
#define INITHUNKMAX 125 /* initial dynamic allocation size */
@@ -563,7 +566,7 @@ intuit_diff_type (bool need_header, mode_t *p_file_type)
p_name[i] = 0;
}
if (! ((p_name[OLD] = parse_name (s + 11, strippath, &u))
- && ISSPACE (*u)
+ && ISSPACE ((unsigned char) *u)
&& (p_name[NEW] = parse_name (u, strippath, &u))
&& (u = skip_spaces (u), ! *u)))
for (i = OLD; i <= NEW; i++)
diff --git a/src/util.c b/src/util.c
index c32f4e7..8796c4e 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1489,7 +1489,7 @@ parse_name (char const *s, int strip_leading, char const **endp)
{
char *ret;
- while (ISSPACE (*s))
+ while (ISSPACE ((unsigned char) *s))
s++;
if (*s == '"')
ret = parse_c_string (s, endp);
@@ -1497,7 +1497,7 @@ parse_name (char const *s, int strip_leading, char const **endp)
{
char const *t;
- for (t = s; *t && ! ISSPACE (*t); t++)
+ for (t = s; *t && ! ISSPACE ((unsigned char) *t); t++)
/* do nothing*/ ;
ret = savebuf (s, t - s + 1);
ret[t - s] = 0;
diff --git a/src/util.h b/src/util.h
index 388a319..a149603 100644
--- a/src/util.h
+++ b/src/util.h
@@ -76,7 +76,7 @@ void set_file_attributes (char const *, enum file_attributes, struct stat *,
static inline char const *
skip_spaces (char const *str)
{
- while (ISSPACE (*str))
+ while (ISSPACE ((unsigned char) *str))
str++;
return str;
}