aboutsummaryrefslogtreecommitdiff
path: root/tr.c
diff options
context:
space:
mode:
Diffstat (limited to 'tr.c')
-rw-r--r--tr.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tr.c b/tr.c
index ff0f331ff..07922af17 100644
--- a/tr.c
+++ b/tr.c
@@ -33,7 +33,7 @@
33 33
34static const int ASCII = 0377; 34static const int ASCII = 0377;
35 35
36/* some glabals shared across this file */ 36/* some "globals" shared across this file */
37static char com_fl, del_fl, sq_fl; 37static char com_fl, del_fl, sq_fl;
38static short in_index, out_index; 38static short in_index, out_index;
39/* these last are pointers to static buffers declared in tr_main */ 39/* these last are pointers to static buffers declared in tr_main */
@@ -90,6 +90,10 @@ static void map(register unsigned char *string1, unsigned int string1_len,
90 } 90 }
91} 91}
92 92
93/* supported constructs:
94 * Ranges, e.g., [0-9] ==> 0123456789
95 * Escapes, e.g., \a ==> Control-G
96 */
93static unsigned int expand(const char *arg, register unsigned char *buffer) 97static unsigned int expand(const char *arg, register unsigned char *buffer)
94{ 98{
95 unsigned char *buffer_start = buffer; 99 unsigned char *buffer_start = buffer;
@@ -110,7 +114,7 @@ static unsigned int expand(const char *arg, register unsigned char *buffer)
110 ac = *arg++; 114 ac = *arg++;
111 while (i <= ac) 115 while (i <= ac)
112 *buffer++ = i++; 116 *buffer++ = i++;
113 arg++; /* Skip ']' */ 117 arg++; /* Skip the assumed ']' */
114 } else 118 } else
115 *buffer++ = *arg++; 119 *buffer++ = *arg++;
116 } 120 }