From Chris Heath: fix up the check for printable ASCII done on Windows
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 1 Aug 2003 01:39:01 +0000 (01:39 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 1 Aug 2003 01:39:01 +0000 (01:39 +0000)
not to include DEL as printable ASCII.

Also change the check in strutil.c to do it by redefining "isprint()",
as is done in "gtk/gtkglobals.h", rather than by #ifdeffing the point at
which the test is done.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8118 f5534014-38df-0310-8fa8-9805f1628bb7

AUTHORS
doc/ethereal.pod.template
epan/strutil.c
gtk/gtkglobals.h

diff --git a/AUTHORS b/AUTHORS
index d6b7ee168e80d5647986e0f00a9b8c92ebba09d5..843bdf6113fa394ab9eae4246c377e8c7ec800e5 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1780,6 +1780,7 @@ And assorted fixes and enhancements by the people listed above and by:
        <smhuang [AT] pcs.csie.nctu.edu.tw>
        Michael Kopp <michael.kopp [AT] isarnet.de>
        Bernd Leibing <bernd.leibing [AT] kiz.uni-ulm.de>
+       Chris Heath <chris [AT] heathens.co.nz>
 
 Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to
 give his permission to use his version of snprintf.c.
index e13a8180e1729200bf3d310c5a455f30c0312206..9d11e8d4b7fbdedd5e1b14f4dfbee10483180071 100644 (file)
@@ -1876,6 +1876,7 @@ B<http://www.ethereal.com>.
                            <smhuang [AT] pcs.csie.nctu.edu.tw>
   Michael Kopp             <michael.kopp [AT] isarnet.de>
   Bernd Leibing            <bernd.leibing [AT] kiz.uni-ulm.de>
+  Chris Heath              <chris [AT] heathens.co.nz>
 
 Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to give his
 permission to use his version of snprintf.c.
index 17f5834cebfa4d2bf2a180e870f4a5660ca1d9ca..45ea39dbffef50b806553c84899ee360d8cbc03d 100644 (file)
@@ -1,7 +1,7 @@
 /* strutil.c
  * String utility routines
  *
- * $Id: strutil.c,v 1.10 2002/12/31 21:51:10 guy Exp $
+ * $Id: strutil.c,v 1.11 2003/08/01 01:39:00 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -133,6 +133,19 @@ get_token_len(const guchar *linep, const guchar *lineend,
 
 #define        INITIAL_FMTBUF_SIZE     128
 
+#ifdef _WIN32
+/*
+ * XXX - "isprint()" can return "true" for non-ASCII characters, but
+ * those don't work with GTK+ on Windows, as GTK+ on Windows assumes
+ * UTF-8 strings.  Until we fix up Ethereal to properly handle
+ * non-ASCII characters in all output (both GUI displays and text
+ * printouts) on all platforms including Windows, we work around
+ * the problem by escaping all characters that aren't printable ASCII.
+ */
+#undef isprint
+#define isprint(c) (c >= 0x20 && c < 0x7f)
+#endif
+
 /*
  * Given a string, generate a string from it that shows non-printable
  * characters as C-style escapes, and return a pointer to it.
@@ -173,19 +186,7 @@ format_text(const guchar *string, int len)
     }
     c = *string++;
 
-#ifdef _WIN32
-    /*
-     * XXX - "isprint()" can return "true" for non-ASCII characters, but
-     * those don't work with GTK+ on Windows, as GTK+ on Windows assumes
-     * UTF-8 strings.  Until we fix up Ethereal to properly handle
-     * non-ASCII characters in all output (both GUI displays and text
-     * printouts) on all platforms including Windows, we work around
-     * the problem by escaping all characters that aren't printable ASCII.
-     */
-    if (c >= 0x20 && c <= 0x7f) {
-#else
     if (isprint(c)) {
-#endif
       fmtbuf[column] = c;
       column++;
     } else {
index 5a445106e0b48055baf41d1d52de5354a0f48d55..8e083271b2ac93b692eac72a26ccf753312712fe 100644 (file)
@@ -1,7 +1,7 @@
 /* gtkglobals.h
  * GTK-related Global defines, etc.
  *
- * $Id: gtkglobals.h,v 1.21 2002/12/31 21:49:00 guy Exp $
+ * $Id: gtkglobals.h,v 1.22 2003/08/01 01:39:01 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -50,7 +50,7 @@ void set_plist_sel_browse(gboolean);
  * the problem by escaping all characters that aren't printable ASCII.
  */
 #undef isprint
-#define isprint(c) (c >= 0x20 && c <= 0x7f)
+#define isprint(c) (c >= 0x20 && c < 0x7f)
 #endif
 
 #endif