bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Parameter Expansion] bug in ${variable% *}


From: Andreas Schwab
Subject: Re: [Parameter Expansion] bug in ${variable% *}
Date: Tue, 12 Feb 2013 17:37:35 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.93 (gnu/linux)

Greg Wooledge <wooledg@eeg.ccf.org> writes:

> Then you are still doing something wrong.

No matter how badly the script is written, bash should execute it
properly, which it doesn't.  Try running it under valgrind in a
multibyte locale and you will see the error immediately:

==18677== Conditional jump or move depends on uninitialised value(s)
==18677==    at 0x4504B6: xdupmbstowcs (xmbsrtowcs.c:240)
==18677==    by 0x42A43F: remove_pattern (subst.c:3964)
==18677==    by 0x42F3B7: parameter_brace_expand (subst.c:4543)
==18677==    by 0x466E48: param_expand (subst.c:7651)
==18677==    by 0x467C91: expand_word_internal (subst.c:8139)
==18677==    by 0x467F24: expand_word_internal (subst.c:8285)
==18677==    by 0x42F981: call_expand_word_internal.constprop.15 (subst.c:3197)
==18677==    by 0x42FD94: expand_string_assignment (subst.c:3283)
==18677==    by 0x466BB3: expand_string_if_necessary (subst.c:3046)
==18677==    by 0x47632F: do_assignment_internal (subst.c:2772)
==18677==    by 0x469726: expand_word_list_internal (subst.c:2866)
==18677==    by 0x45CCB3: execute_simple_command (execute_cmd.c:3776)
==18677== 

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]