mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-31 11:41:32 +01:00
(copy_and_escape): Relaxed quoting.
This commit is contained in:
parent
389fa08de6
commit
5b9023c6e7
@ -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>
|
||||
|
||||
* errors.h (STATUS_NEWSIG): New.
|
||||
|
@ -357,19 +357,21 @@ static char *
|
||||
copy_and_escape (char *buffer, const char *text)
|
||||
{
|
||||
int i;
|
||||
const unsigned char *s = text;
|
||||
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;
|
||||
}
|
||||
else if (text[i] == ' ')
|
||||
else if (s[i] == ' ')
|
||||
*p++ = '+';
|
||||
else
|
||||
*p++ = text[i];
|
||||
*p++ = s[i];
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user