(copy_and_escape): Relaxed quoting.

This commit is contained in:
Werner Koch 2004-04-13 09:45:23 +00:00
parent 389fa08de6
commit 5b9023c6e7
2 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2004-04-13 Werner Koch <wk@gnupg.org>
* simple-pwquery.c (copy_and_escape): Relaxed quoting.
2004-04-05 Werner Koch <wk@gnupg.org> 2004-04-05 Werner Koch <wk@gnupg.org>
* errors.h (STATUS_NEWSIG): New. * errors.h (STATUS_NEWSIG): New.

View File

@ -357,19 +357,21 @@ static char *
copy_and_escape (char *buffer, const char *text) copy_and_escape (char *buffer, const char *text)
{ {
int i; int i;
const unsigned char *s = text;
char *p = buffer; char *p = buffer;
for (i=0; text[i]; i++) for (i=0; s[i]; i++)
{ {
if (text[i] < ' ' || text[i] == '+') if (s[i] < ' ' || s[i] == '+')
{ {
sprintf (p, "%%%02X", text[i]); sprintf (p, "%%%02X", s[i]);
p += 3; p += 3;
} }
else if (text[i] == ' ') else if (s[i] == ' ')
*p++ = '+'; *p++ = '+';
else else
*p++ = text[i]; *p++ = s[i];
} }
return p; return p;
} }