Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/libbb/printable.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/libbb/printable.c

    r2725 r3621  
    3333    fputc(ch, file);
    3434}
     35
     36void FAST_FUNC visible(unsigned ch, char *buf, int flags)
     37{
     38    if (ch == '\t' && !(flags & VISIBLE_SHOW_TABS)) {
     39        goto raw;
     40    }
     41    if (ch == '\n') {
     42        if (flags & VISIBLE_ENDLINE)
     43            *buf++ = '$';
     44    } else {
     45        if (ch >= 128) {
     46            ch -= 128;
     47            *buf++ = 'M';
     48            *buf++ = '-';
     49        }
     50        if (ch < 32 || ch == 127) {
     51            *buf++ = '^';
     52            ch ^= 0x40;
     53        }
     54    }
     55 raw:
     56    *buf++ = ch;
     57    *buf = '\0';
     58}
Note: See TracChangeset for help on using the changeset viewer.