aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--g10/cpr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/g10/cpr.c b/g10/cpr.c
index 28cba698f..0d424e55f 100644
--- a/g10/cpr.c
+++ b/g10/cpr.c
@@ -353,6 +353,7 @@ write_status_text_and_buffer (int no, const char *string,
const char *s, *text;
int esc, first;
int lower_limit = ' ';
+ int escape_more;
size_t n, count, dowrap;
if (!statusfp || !status_currently_allowed (no))
@@ -364,6 +365,8 @@ write_status_text_and_buffer (int no, const char *string,
wrap = 0;
}
+ escape_more = (no == STATUS_NOTATION_NAME || no == STATUS_NOTATION_DATA);
+
text = get_status_string (no);
count = dowrap = first = 1;
do
@@ -388,7 +391,7 @@ write_status_text_and_buffer (int no, const char *string,
for (esc=0, s=buffer, n=len; n; s++, n--)
{
if (*s == '%' || *(const byte*)s <= lower_limit
- || *(const byte*)s == 127 )
+ || *(const byte*)s == 127 || (escape_more && (*s & 0x80)))
esc = 1;
if (wrap && ++count > wrap)
dowrap=1;