assignment statements. We now do tilde expansion on such words
even in POSIX mode. */
if (word->flags & (W_ASSIGNRHS|W_NOTILDE))
- goto add_character;
+ {
+ if (isexp == 0 && isifs (c))
+ goto add_ifs_character;
+ else
+ goto add_character;
+ }
/* If we're not in posix mode or forcing assignment-statement tilde
expansion, note where the `=' appears in the word and prepare to
do tilde expansion following the first `='. */
string[sindex+1] == '~')
word->flags |= W_ITILDE;
#endif
- goto add_character;
+ if (isexp == 0 && isifs (c))
+ goto add_ifs_character;
+ else
+ goto add_character;
case ':':
if (word->flags & W_NOTILDE)
- goto add_character;
+ {
+ if (isexp == 0 && isifs (c))
+ goto add_ifs_character;
+ else
+ goto add_character;
+ }
if ((word->flags & (W_ASSIGNMENT|W_ASSIGNRHS|W_TILDEEXP)) &&
string[sindex+1] == '~')
word->flags |= W_ITILDE;
- goto add_character;
+
+ if (isexp == 0 && isifs (c))
+ goto add_ifs_character;
+ else
+ goto add_character;
case '~':
/* If the word isn't supposed to be tilde expanded, or we're not
(quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)))
{
word->flags &= ~W_ITILDE;
- goto add_character;
+ if (isexp == 0 && isifs (c) && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) == 0)
+ goto add_ifs_character;
+ else
+ goto add_character;
}
if (word->flags & W_ASSIGNRHS)
default:
/* This is the fix for " $@ " */
+ add_ifs_character:
if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || (isexp == 0 && isifs (c)))
{
if (string[sindex]) /* from old goto dollar_add_string */