From da7ca7f1991964ba2de6a6c49ba6239697f3a4cc Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Wed, 16 Apr 2008 03:26:46 +0200
Subject: [PATCH] Fix use of isspace() function.

---
 ChangeLog  | 4 ++++
 lib/trim.c | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2ceaa9c241..c859ea60bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-04-15  Bruno Haible  <bruno@clisp.org>
+
+	* lib/trim.c (trim2): Fix argument of isspace() macro.
+
 2008-04-15  Paolo Bonzini  <bonzini@gnu.org>
 
 	* lib/tanl.c (kernel_tanl): Rename flag to invert, initialize it
diff --git a/lib/trim.c b/lib/trim.c
index 6a71578bf6..3813ca88ab 100644
--- a/lib/trim.c
+++ b/lib/trim.c
@@ -113,7 +113,7 @@ trim2(const char *s, int how)
       
       /* Trim leading whitespaces. */
       if (how != TRIM_TRAILING) {
-	for (p = d; *p && isspace (*p); p++)
+	for (p = d; *p && isspace ((unsigned char) *p); p++)
 	  ;			
 
 	memmove (d, p, strlen (p) + 1);
@@ -121,7 +121,7 @@ trim2(const char *s, int how)
 
       /* Trim trailing whitespaces. */
       if (how != TRIM_LEADING) {
-	for (p = d + strlen (d) - 1; p >= d && isspace (*p); p--)
+	for (p = d + strlen (d) - 1; p >= d && isspace ((unsigned char) *p); p--)
 	  *p = '\0';
       }
     }
-- 
2.39.5