aboutsummaryrefslogtreecommitdiffstats
path: root/lwlib
diff options
context:
space:
mode:
authorPaul Eggert <[email protected]>2012-08-16 14:58:44 -0700
committerPaul Eggert <[email protected]>2012-08-16 14:58:44 -0700
commit620f13b0612810324592ab2d2b4e5a5dab27f981 (patch)
tree844d21f0c90ede1887eb699058398f5f9a81f069 /lwlib
parent85c2386bbe5d7957cf5750b6f96b2868f83eedf4 (diff)
Use ASCII tests for character types.
* admin/merge-gnulib (GNULIB_MODULES): Add c-ctype. * lwlib/lwlib-Xaw.c, lwlib/lwlib.c, lwlib/xlwmenu.c: Don't include <ctype.h>; no longer needed. * lwlib/lwlib-Xaw.c (openFont): * lwlib/xlwmenu.c (openXftFont): Test just for ASCII digits. * src/category.c, src/dispnew.c, src/doprnt.c, src/editfns.c, src/syntax.c * src/term.c, src/xfns.c, src/xterm.c: Don't include <ctype.h>; was not needed. * src/charset.c, src/doc.c, src/fileio.c, src/font.c, src/frame.c: * src/gtkutil.c, src/image.c, src/sysdep.c, src/xfaces.c: Include <c-ctype.h> instead of <ctype.h>. * src/nsterm.m: Include <c-ctype.h>. * src/charset.c (read_hex): * src/doc.c (Fsnarf_documentation): * src/fileio.c (IS_DRIVE) [WINDOWSNT]: (DRIVE_LETTER) [DOS_NT]: (Ffile_name_directory, Fexpand_file_name) (Fsubstitute_in_file_name): * src/font.c (font_parse_xlfd, font_parse_fcname): * src/frame.c (x_set_font_backend): * src/gtkutil.c (xg_get_font): * src/image.c (xbm_scan, xpm_scan, pbm_scan_number): * src/nsimage.m (hexchar): * src/nsterm.m (ns_xlfd_to_fontname): * src/sysdep.c (system_process_attributes): * src/xfaces.c (hash_string_case_insensitive): Use C-locale tests instead of locale-specific tests for character types, since we want the ASCII interpretation here, not the interpretation suitable for whatever happens to be the current locale.
Diffstat (limited to 'lwlib')
-rw-r--r--lwlib/ChangeLog8
-rw-r--r--lwlib/lwlib-Xaw.c3
-rw-r--r--lwlib/lwlib.c1
-rw-r--r--lwlib/xlwmenu.c3
4 files changed, 10 insertions, 5 deletions
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog
index 8d36e2e22d..7d49d9b531 100644
--- a/lwlib/ChangeLog
+++ b/lwlib/ChangeLog
@@ -1,3 +1,11 @@
+2012-08-16 Paul Eggert <[email protected]>
+
+ Use ASCII tests for character types.
+ * lwlib-Xaw.c, lwlib.c, xlwmenu.c:
+ Don't include <ctype.h>; no longer needed.
+ * lwlib-Xaw.c (openFont):
+ * xlwmenu.c (openXftFont): Test just for ASCII digits.
+
2012-08-01 Glenn Morris <[email protected]>
* Makefile.in (config_h): Add conf_post.h.
diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c
index 7f834df1aa..d37fb70fdb 100644
--- a/lwlib/lwlib-Xaw.c
+++ b/lwlib/lwlib-Xaw.c
@@ -24,7 +24,6 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include <setjmp.h>
-#include <ctype.h>
#include <lisp.h>
@@ -125,7 +124,7 @@ openFont (Widget widget, char *name)
XftFont *fn;
/* Try to convert Gtk-syntax (Sans 9) to Xft syntax Sans-9. */
- while (i > 0 && isdigit (fname[i]))
+ while (i > 0 && '0' <= fname[i] && fname[i] <= '9')
--i;
if (fname[i] == ' ')
{
diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c
index 5820be8d7a..ad3792dd59 100644
--- a/lwlib/lwlib.c
+++ b/lwlib/lwlib.c
@@ -28,7 +28,6 @@ Boston, MA 02110-1301, USA. */
#include <sys/types.h>
#include <stdio.h>
-#include <ctype.h>
#include "lwlib-int.h"
#include "lwlib-utils.h"
#include <X11/StringDefs.h>
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c
index e8831c37f8..c76cb1a3f3 100644
--- a/lwlib/xlwmenu.c
+++ b/lwlib/xlwmenu.c
@@ -28,7 +28,6 @@ Boston, MA 02110-1301, USA. */
#include <lisp.h>
#include <stdio.h>
-#include <ctype.h>
#include <sys/types.h>
#if (defined __sun) && !(defined SUNOS41)
@@ -1858,7 +1857,7 @@ openXftFont (XlwMenuWidget mw)
int screen = XScreenNumberOfScreen (mw->core.screen);
int len = strlen (fname), i = len-1;
/* Try to convert Gtk-syntax (Sans 9) to Xft syntax Sans-9. */
- while (i > 0 && isdigit (fname[i]))
+ while (i > 0 && '0' <= fname[i] && fname[i] <= '9')
--i;
if (fname[i] == ' ')
{