[hackers] [sbase] tr: fix escape code handling in set2 || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Wed, 09 Apr 2014 16:40:10 +0200

commit 3e49e946b76e235dfa08e461041f6ae36151062b
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Wed Apr 9 14:03:02 2014 +0200

    tr: fix escape code handling in set2
    
    Signed-off-by: Hiltjo Posthuma <hiltjo_AT_codemadness.org>

diff --git a/tr.c b/tr.c
index b336f57..0ac0c86 100644
--- a/tr.c
+++ b/tr.c
_AT_@ -49,32 +49,30 @@ handleescapes(char *s)
 static void
 parsemapping(const char *set1, const char *set2, wchar_t *mappings)
 {
- char *s;
+ char *s1, *s2;
         wchar_t runeleft;
         wchar_t runeright;
         int leftbytes;
         int rightbytes;
- size_t n = 0;
- size_t lset2;
 
- if(set2) {
- lset2 = strnlen(set2, 255 * sizeof(wchar_t));
- } else {
- set2 = &set1[0];
- lset2 = 0;
- }
-
- s = (char *)set1;
- while(*s) {
- if(*s == '\')
- handleescapes(++s);
- leftbytes = mbtowc(&runeleft, s, 4);
- if(set2[n] != '
Received on Wed Apr 09 2014 - 16:40:10 CEST

This archive was generated by hypermail 2.3.0 : Wed Apr 09 2014 - 16:48:21 CEST