Dr. Werner Fink 2011-06-10 08:24:05 +00:00 committed by Git OBS Bridge
parent c7704d134c
commit 913bc64e52

View File

@ -116,8 +116,17 @@
else else
{ {
--- src/cmd/ksh93/sh/macro.c --- src/cmd/ksh93/sh/macro.c
+++ src/cmd/ksh93/sh/macro.c 2011-06-08 11:32:23.723926336 +0000 +++ src/cmd/ksh93/sh/macro.c 2011-06-10 08:20:29.451926367 +0000
@@ -494,7 +494,7 @@ static void copyto(register Mac_t *mp,in @@ -51,6 +51,8 @@
#if !SHOPT_MULTIBYTE
#define mbchar(p) (*(unsigned char*)p++)
+#else
+#define mb2wc(w,p,n) (*ast.mb_towc)(&w,(char*)p,n)
#endif
static int _c_;
@@ -494,7 +496,7 @@ static void copyto(register Mac_t *mp,in
int i; int i;
unsigned char mb[8]; unsigned char mb[8];
@ -126,7 +135,7 @@
for(i=0;i<n;i++) for(i=0;i<n;i++)
sfputc(stkp,mb[i]); sfputc(stkp,mb[i]);
} }
@@ -1908,6 +1908,9 @@ static void comsubst(Mac_t *mp,register @@ -1908,6 +1910,9 @@ static void comsubst(Mac_t *mp,register
struct _mac_ savemac; struct _mac_ savemac;
int savtop = stktell(stkp); int savtop = stktell(stkp);
char lastc, *savptr = stkfreeze(stkp,0); char lastc, *savptr = stkfreeze(stkp,0);
@ -136,7 +145,7 @@
int was_history = sh_isstate(SH_HISTORY); int was_history = sh_isstate(SH_HISTORY);
int was_verbose = sh_isstate(SH_VERBOSE); int was_verbose = sh_isstate(SH_VERBOSE);
int was_interactive = sh_isstate(SH_INTERACTIVE); int was_interactive = sh_isstate(SH_INTERACTIVE);
@@ -2025,6 +2028,9 @@ static void comsubst(Mac_t *mp,register @@ -2025,6 +2030,9 @@ static void comsubst(Mac_t *mp,register
stkset(stkp,savptr,savtop); stkset(stkp,savptr,savtop);
newlines = 0; newlines = 0;
lastc = 0; lastc = 0;
@ -146,7 +155,7 @@
sfsetbuf(sp,(void*)sp,0); sfsetbuf(sp,(void*)sp,0);
bufsize = sfvalue(sp); bufsize = sfvalue(sp);
/* read command substitution output and put on stack or here-doc */ /* read command substitution output and put on stack or here-doc */
@@ -2075,6 +2081,17 @@ static void comsubst(Mac_t *mp,register @@ -2075,6 +2083,17 @@ static void comsubst(Mac_t *mp,register
} }
else if(lastc) else if(lastc)
{ {
@ -164,7 +173,7 @@
mac_copy(mp,&lastc,1); mac_copy(mp,&lastc,1);
lastc = 0; lastc = 0;
} }
@@ -2083,8 +2100,22 @@ static void comsubst(Mac_t *mp,register @@ -2083,8 +2102,22 @@ static void comsubst(Mac_t *mp,register
str[c] = 0; str[c] = 0;
else else
{ {
@ -188,7 +197,7 @@
str[c] = 0; str[c] = 0;
} }
mac_copy(mp,str,c); mac_copy(mp,str,c);
@@ -2102,7 +2133,21 @@ static void comsubst(Mac_t *mp,register @@ -2102,7 +2135,21 @@ static void comsubst(Mac_t *mp,register
sfnputc(stkp,'\n',newlines); sfnputc(stkp,'\n',newlines);
} }
if(lastc) if(lastc)
@ -210,7 +219,7 @@
sfclose(sp); sfclose(sp);
return; return;
} }
@@ -2173,13 +2218,13 @@ static void mac_copy(register Mac_t *mp, @@ -2173,13 +2220,13 @@ static void mac_copy(register Mac_t *mp,
if(mp->pattern) if(mp->pattern)
{ {
char *sp = "&|()"; char *sp = "&|()";