• merge printf from OpenBSD
• deactivate %a and %A since our libc doesn’t have it • rewrite the mksh integration code to use shf instead of stdio, removing floating point support always in the process, as shf doesn’t support it ⇒ saves 11114 (6706 text, 168 data, 4240 bss) with dietlibc on Debian • fix -Wall -Wextra -Wformat -Wstrict-aliasing=2 for gcc (Debian 4.4.4-7) • fix these and -Wc++-compat for gcc version 4.6.0 20100711 (experimental) [trunk revision 162057] (Debian 20100711-1) except: – a few enum warnings that relate to eglibc’s {g,s}etrlimit() functions taking an enum instead of an int because they’re too stupid to adhere to POSIX interfaces they design by themselves – all “request for implicit conversion” involving a "void *" on one side • tweak the manual page somewhat more
This commit is contained in:
18
eval.c
18
eval.c
@ -22,7 +22,7 @@
|
||||
|
||||
#include "sh.h"
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.89 2010/05/16 19:17:42 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.90 2010/07/17 22:09:33 tg Exp $");
|
||||
|
||||
/*
|
||||
* string expansion
|
||||
@ -1559,19 +1559,19 @@ alt_expand(XPtrV *wp, char *start, char *exp_start, char *end, int fdo)
|
||||
count++;
|
||||
else if ((*p == CBRACE && --count == 0) ||
|
||||
(*p == ',' && count == 1)) {
|
||||
char *new;
|
||||
char *news;
|
||||
int l1, l2, l3;
|
||||
|
||||
l1 = brace_start - start;
|
||||
l2 = (p - 1) - field_start;
|
||||
l3 = end - brace_end;
|
||||
new = alloc(l1 + l2 + l3 + 1, ATEMP);
|
||||
memcpy(new, start, l1);
|
||||
memcpy(new + l1, field_start, l2);
|
||||
memcpy(new + l1 + l2, brace_end, l3);
|
||||
new[l1 + l2 + l3] = '\0';
|
||||
alt_expand(wp, new, new + l1,
|
||||
new + l1 + l2 + l3, fdo);
|
||||
news = alloc(l1 + l2 + l3 + 1, ATEMP);
|
||||
memcpy(news, start, l1);
|
||||
memcpy(news + l1, field_start, l2);
|
||||
memcpy(news + l1 + l2, brace_end, l3);
|
||||
news[l1 + l2 + l3] = '\0';
|
||||
alt_expand(wp, news, news + l1,
|
||||
news + l1 + l2 + l3, fdo);
|
||||
field_start = p + 1;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user