mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-05 11:20:50 +02:00
fix to readline redisplay of invisible chars at end of line; fix to here-document delimiter quote removal; prompt expansion makes invisible chars in w, W, s visible
This commit is contained in:
+8
-5
@@ -52,10 +52,11 @@
|
||||
#define UNMETA(c) ((c) & 0x7f)
|
||||
#endif
|
||||
|
||||
static int
|
||||
charvis (s, sindp, ret, rindp)
|
||||
int
|
||||
sh_charvis (s, sindp, slen, ret, rindp)
|
||||
const char *s;
|
||||
size_t *sindp;
|
||||
size_t slen;
|
||||
char *ret;
|
||||
size_t *rindp;
|
||||
{
|
||||
@@ -68,7 +69,7 @@ charvis (s, sindp, ret, rindp)
|
||||
ri = *rindp;
|
||||
c = s[*sindp];
|
||||
|
||||
send = (locale_mb_cur_max > 1) ? s + strlen (s) : 0;
|
||||
send = (locale_mb_cur_max > 1) ? s + slen : 0;
|
||||
|
||||
if (SAFECHAR (c))
|
||||
{
|
||||
@@ -87,7 +88,9 @@ charvis (s, sindp, ret, rindp)
|
||||
ret[ri++] = UNCTRL (c);
|
||||
si++;
|
||||
}
|
||||
else if (locale_mb_cur_max > 1)
|
||||
else if (locale_utf8locale && (c & 0x80))
|
||||
COPY_CHAR_I (ret, ri, s, send, si);
|
||||
else if (locale_mb_cur_max > 1 && is_basic (c) == 0)
|
||||
COPY_CHAR_I (ret, ri, s, send, si);
|
||||
else if (META_CHAR (c))
|
||||
{
|
||||
@@ -138,7 +141,7 @@ sh_strvis (string)
|
||||
sind = 0;
|
||||
|
||||
while (string[sind])
|
||||
sind = charvis (string, &sind, ret, &retind);
|
||||
sind = sh_charvis (string, &sind, slen, ret, &retind);
|
||||
|
||||
ret[retind] = '\0';
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user