diff --git a/g10/ChangeLog b/g10/ChangeLog index a170c915d..1e72d2a0d 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,10 @@ +2002-03-29 David Shaw + + * keyserver.c (printunquoted): unquote backslashes from keyserver + searches + + * hkp.c (write_quoted): quote backslashes from keyserver searches + 2002-03-23 David Shaw * import.c (append_uid, merge_sigs): it is okay to import diff --git a/g10/hkp.c b/g10/hkp.c index 62568f70f..3a7b654f6 100644 --- a/g10/hkp.c +++ b/g10/hkp.c @@ -234,6 +234,11 @@ write_quoted(IOBUF a, const char *buf, char delim) if(iobuf_writestr(a,quoted)) return -1; } + else if(*buf=='\\') + { + if(iobuf_writestr(a,"\\x5c")) + return -1; + } else { if(iobuf_writebyte(a,*buf)) diff --git a/g10/keyserver.c b/g10/keyserver.c index 717c8643e..d5a65526e 100644 --- a/g10/keyserver.c +++ b/g10/keyserver.c @@ -152,7 +152,7 @@ parse_keyserver_uri(char *uri) return 0; } -/* Unquote only the delimiter character */ +/* Unquote only the delimiter character and backslash */ static void printunquoted(char *string,char delim) { @@ -164,12 +164,17 @@ printunquoted(char *string,char delim) { int c; - sscanf(ch,"\\x%02X",&c); + sscanf(ch,"\\x%02x",&c); if(c==delim) { printf("%c",c); ch+=3; } + else if(c=='\\') + { + fputc('\\',stdout); + ch+=3; + } else fputc(*ch,stdout); }