Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/coreutils/tr.c


Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/coreutils/tr.c

    r3232 r3621  
    9292 *   Equiv classess, e.g. [=A=] ==> A   (hmmmmmmm?)
    9393 * not supported:
    94  *   \ooo-\ooo - octal ranges
    9594 *   [x*N] - repeat char x N times
    9695 *   [x*] - repeat char x until it fills STRING2:
     
    10099 * qweddd
    101100 */
    102 static unsigned expand(const char *arg, char **buffer_p)
     101static unsigned expand(char *arg, char **buffer_p)
    103102{
    104103    char *buffer = *buffer_p;
     
    114113        }
    115114        if (*arg == '\\') {
     115            const char *z;
    116116            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             */
    119126        }
    120127        if (arg[1] == '-') { /* "0-9..." */
     
    125132            }
    126133            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            }
    127141            while (i <= ac) /* ok: i is unsigned _int_ */
    128142                buffer[pos++] = i++;
    129             arg += 3; /* skip 0-9 */
    130143            continue;
    131144        }
Note: See TracChangeset for help on using the changeset viewer.