Displaying 4 results from an estimated 4 matches for "octtobin".
Did you mean:
cttobin
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Optimise handling of backslash octals in printf
...processing.... */
c = ch = 0x100;
continue;
@@ -288,24 +288,11 @@ conv_escape_str(char *str, char **sp)
* They start with a \0, and are followed by 0, 1, 2,
* or 3 octal digits.
*/
- if (ch == '0') {
- unsigned char i;
- i = 3;
- c = 0;
- do {
- unsigned k = octtobin(*str);
- if (k > 7)
- break;
- str++;
- c <<= 3;
- c += k;
- } while (--i);
- continue;
- }
+ if (c == '0' && isodigit(*str))
+ str++;
/* Finally test for sequences valid in the format string */
str = conv_escape(str - 1, &c);
- ch = c;...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Optimise handling of backslash octals in printf
...processing.... */
c = ch = 0x100;
continue;
@@ -288,24 +288,11 @@ conv_escape_str(char *str, char **sp)
* They start with a \0, and are followed by 0, 1, 2,
* or 3 octal digits.
*/
- if (ch == '0') {
- unsigned char i;
- i = 3;
- c = 0;
- do {
- unsigned k = octtobin(*str);
- if (k > 7)
- break;
- str++;
- c <<= 3;
- c += k;
- } while (--i);
- continue;
- }
+ if (c == '0' && isodigit(*str))
+ str++;
/* Finally test for sequences valid in the format string */
str = conv_escape(str - 1, &c);
- ch = c;...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Handle embedded NULs correctly in printf
...if (ch == 'c') {
/* \c as in SYSV echo - abort all processing.... */
- ch = 0x100;
+ c = ch = 0x100;
continue;
}
@@ -257,14 +300,14 @@ conv_escape_str(char *str)
if (ch == '0') {
unsigned char i;
i = 3;
- ch = 0;
+ c = 0;
do {
unsigned k = octtobin(*str);
if (k > 7)
break;
str++;
- ch <<= 3;
- ch += k;
+ c <<= 3;
+ c += k;
} while (--i);
continue;
}
@@ -272,7 +315,9 @@ conv_escape_str(char *str)
/* Finally test for sequences valid in the format string */
str = conv_escape(str - 1, &a...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Handle embedded NULs correctly in printf
...if (ch == 'c') {
/* \c as in SYSV echo - abort all processing.... */
- ch = 0x100;
+ c = ch = 0x100;
continue;
}
@@ -257,14 +300,14 @@ conv_escape_str(char *str)
if (ch == '0') {
unsigned char i;
i = 3;
- ch = 0;
+ c = 0;
do {
unsigned k = octtobin(*str);
if (k > 7)
break;
str++;
- ch <<= 3;
- ch += k;
+ c <<= 3;
+ c += k;
} while (--i);
continue;
}
@@ -272,7 +315,9 @@ conv_escape_str(char *str)
/* Finally test for sequences valid in the format string */
str = conv_escape(str - 1, &a...