commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-268-g4850a


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-268-g4850ad6
Date: Fri, 05 Apr 2013 09:33:57 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  4850ad628e9fb0e85d305bb44ef17ba7f56bf8e4 (commit)
      from  58d533764dd4e50bd48c835db80d35693e5dabca (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=4850ad628e9fb0e85d305bb44ef17ba7f56bf8e4


commit 4850ad628e9fb0e85d305bb44ef17ba7f56bf8e4
Author: Mats Erik Andersson <address@hidden>
Date:   Fri Apr 5 11:09:50 2013 +0200

    talk: Non-ASCII characters.

diff --git a/ChangeLog b/ChangeLog
index 912d03f..02541c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2013-04-05  Mats Erik Andersson  <address@hidden>
 
+       talk: Non-ASCII characters.
+
+       * talk/display.c: Include <ctype.h>.
+       (display): Check printability with isprint().
+       Prevent sign extension of char as integer.
+
+2013-04-05  Mats Erik Andersson  <address@hidden>
+
        talk: Address resolution.
 
        * talk/get_addrs.c (get_addrs): Implement resolver
diff --git a/talk/display.c b/talk/display.c
index 6df1ada..64b77f3 100644
--- a/talk/display.c
+++ b/talk/display.c
@@ -54,6 +54,7 @@
 
 #include <config.h>
 
+#include <ctype.h>
 #include "talk.h"
 
 xwin_t my_win;
@@ -202,7 +203,18 @@ display (register xwin_t * win, register char *text, int 
size)
          /* check for wraparound */
          xscroll (win, 0);
        }
-      if (*text < ' ' && *text != '\t')
+
+      /*
+       * Printable characters, SP, and TAB are printed
+       * verbatim.  Characters beyond the ASCII table
+       * must be handled.  Beware of sign extension!
+       *
+       * The locale setting is in effect when testing
+       * printability of any input character.
+       */
+      if (isprint (*text & 0xff) || *text == '\t')
+       waddch (win->x_win, *text & 0xff);
+      else
        {
          waddch (win->x_win, '^');
          getyx (win->x_win, win->x_line, win->x_col);
@@ -211,8 +223,7 @@ display (register xwin_t * win, register char *text, int 
size)
          cch = (*text & 63) + 64;
          waddch (win->x_win, cch);
        }
-      else
-       waddch (win->x_win, *text);
+
       getyx (win->x_win, win->x_line, win->x_col);
       text++;
     }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog      |    8 ++++++++
 talk/display.c |   17 ++++++++++++++---
 2 files changed, 22 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]