mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
SHOPT_MULTIBYTE-related cleanup (re: 8477d2ce)
As of 8477d2ce, the mbwide() macro (which tests if we're in a
multibyte locale, i.e. UTF-8) is redefined as a constant 0 if we're
compiling without SHOPT_MULTIBYTE. See src/cmd/ksh93/include/defs.h
The other multibyte macros use mbwide() as well, so they all revert
to the single-byte fallbacks in that case, and the multibyte code
in them is never compiled. See src/lib/libast/include/ast.h
Consequently we can now do a bit of cleanup and get rid of many of
the '#if SHOPT_MULTIBYTE' directives, as the compiler optimiser
will happily remove the multibyte-specific code. This increases the
legibility of the ksh code.
I'm taking the opportunity to fix a few typos and whitespace
formatting glitches as well.
This commit is contained in:
parent
7c5d39fa04
commit
f8feed1bd2
9 changed files with 28 additions and 76 deletions
|
|
@ -249,7 +249,6 @@ void sh_trim(register char *sp)
|
|||
dp = sp;
|
||||
while(c= *sp)
|
||||
{
|
||||
#if SHOPT_MULTIBYTE
|
||||
int len;
|
||||
if(mbwide() && (len=mbsize(sp))>1)
|
||||
{
|
||||
|
|
@ -258,7 +257,6 @@ void sh_trim(register char *sp)
|
|||
sp += len;
|
||||
continue;
|
||||
}
|
||||
#endif /* SHOPT_MULTIBYTE */
|
||||
sp++;
|
||||
if(c == '\\')
|
||||
c = *sp++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue