diff options
author | Jim Meyering <meyering@redhat.com> | 2010-03-18 18:10:29 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2010-04-05 22:19:49 +0200 |
commit | eb8258b8c6b3930e06fc20b02456448c43daeff1 (patch) | |
tree | 764b23c0f0511bcbf447f62506d9a0bfe6d2275d | |
parent | f21d1195aef067e6459cca8a1b79a50498a10532 (diff) | |
download | diffutils-eb8258b8c6b3930e06fc20b02456448c43daeff1.tar.gz |
diff -F/-p: don't depend on locale-specific white-space definition
* src/context.c: Include "c-ctype.h".
Use c_isspace, not isspace.
-rw-r--r-- | src/context.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/context.c b/src/context.c index 84120f0..0be8cc5 100644 --- a/src/context.c +++ b/src/context.c @@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "diff.h" +#include "c-ctype.h" #include <inttostr.h> #include <stat-time.h> #include <strftime.h> @@ -147,11 +148,11 @@ print_context_function (FILE *out, char const *function) { int i, j; putc (' ', out); - for (i = 0; isspace ((unsigned char)function[i]) && function[i] != '\n'; i++) + for (i = 0; c_isspace ((unsigned char) function[i]) && function[i] != '\n'; i++) continue; for (j = i; j < i + 40 && function[j] != '\n'; j++) continue; - while (i < j && isspace ((unsigned char) function[j - 1])) + while (i < j && c_isspace ((unsigned char) function[j - 1])) j--; fwrite (function + i, sizeof (char), j - i, out); } |