the character sequence '$((' was incorrectly interpreted as the
opening of arithmetic even within single-quoted contexts, thereby
suppressing the checks for bad characters after the closing quote.
presently bad character checking is only performed when the WRDE_NOCMD
is used; this patch only corrects checking in that case.
(cherry picked from commit
594ffed82f4e6ee7da85e9c5da35e32946ae32c9)
if (!(sq|dq|np)) return WRDE_BADCHAR;
break;
case '$':
+ if (sq) break;
if (s[i+1]=='(' && s[i+2]=='(') {
i += 2;
np += 2;