Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/coreutils/tr.c
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (7 years ago)
- Location:
- branches/3.3
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/coreutils/tr.c
r3232 r3621 92 92 * Equiv classess, e.g. [=A=] ==> A (hmmmmmmm?) 93 93 * not supported: 94 * \ooo-\ooo - octal ranges95 94 * [x*N] - repeat char x N times 96 95 * [x*] - repeat char x until it fills STRING2: … … 100 99 * qweddd 101 100 */ 102 static unsigned expand(c onst char *arg, char **buffer_p)101 static unsigned expand(char *arg, char **buffer_p) 103 102 { 104 103 char *buffer = *buffer_p; … … 114 113 } 115 114 if (*arg == '\\') { 115 const char *z; 116 116 arg++; 117 buffer[pos++] = bb_process_escape_sequence(&arg); 118 continue; 117 z = arg; 118 ac = bb_process_escape_sequence(&z); 119 arg = (char *)z; 120 arg--; 121 *arg = ac; 122 /* 123 * fall through, there may be a range. 124 * If not, current char will be treated anyway. 125 */ 119 126 } 120 127 if (arg[1] == '-') { /* "0-9..." */ … … 125 132 } 126 133 i = (unsigned char) *arg; 134 arg += 3; /* skip 0-9 or 0-\ */ 135 if (ac == '\\') { 136 const char *z; 137 z = arg; 138 ac = bb_process_escape_sequence(&z); 139 arg = (char *)z; 140 } 127 141 while (i <= ac) /* ok: i is unsigned _int_ */ 128 142 buffer[pos++] = i++; 129 arg += 3; /* skip 0-9 */130 143 continue; 131 144 }
Note:
See TracChangeset
for help on using the changeset viewer.