* - parsing assistance functions (mainly for domains inside datagrams)
*/
/*
- * This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+ * This file is
+ * Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
qbuf[0]= 0;
for (i=0; i<len; i++) {
ch= buf[i];
- if (ch == '.' || ch == '"' || ch == '(' || ch == ')' ||
- ch == '@' || ch == ';' || ch == '$' || ch == '\\') {
- sprintf(qbuf,"\\%c",ch);
- break;
- } else if (ch <= ' ' || ch >= 127) {
+ if (ch <= ' ' || ch >= 127) {
sprintf(qbuf,"\\%03o",ch);
break;
+ } else if (!ctype_domainunquoted(ch)) {
+ sprintf(qbuf,"\\%c",ch);
+ break;
}
}
if (!adns__vbuf_append(vb,buf,i) || !adns__vbuf_append(vb,qbuf,strlen(qbuf)))