{
int c;
int p; /* 0 -> no parenthese seen, >0 nr of ( seen */
- int com;
+ int com, quoted;
char *t;
size_t i;
const char *d;
- const char *del;
+ const char *del;
/* standard delimeters */
if (!delim) {
p = 0;
i = 0;
com = 0;
+ quoted = 0;
t = token;
+ if (delim[0] == '"') {
+ quoted = 1;
+ }
while ((c = getc(f)) != EOF) {
if (c == '(') {
/* this only counts for non-comments */
}
/* do something with comments ; */
- if (c == ';') {
+ if (c == ';' && quoted == 0) {
com = 1;
}
+ if (c == '\"' && com == 0) {
+ quoted = 1 - quoted;
+ }
if (c == '\n' && com != 0) {
/* comments */
{
int c, lc;
int p; /* 0 -> no parenthese seen, >0 nr of ( seen */
- int com;
+ int com, quoted;
char *t;
size_t i;
const char *d;
- const char *del;
+ const char *del;
/* standard delimiters */
if (!delim) {
p = 0;
i = 0;
com = 0;
+ quoted = 0;
t = token;
lc = 0;
+ if (delim[0] == '"') {
+ quoted = 1;
+ }
+
while ((c = ldns_bgetc(b)) != EOF) {
if (c == '(') {
p++;
}
/* do something with comments ; */
- if (c == ';') {
+ if (c == ';' && quoted == 0) {
com = 1;
}
+ if (c == '"' && com == 0) {
+ quoted = 1 - quoted;
+ }
if (c == '\n' && com != 0) {
/* comments */
while (*(ldns_buffer_current(rd_buf)) == ' ') {
ldns_buffer_skip(rd_buf, 1);
}
+
if (*(ldns_buffer_current(rd_buf)) == '\"') {
delimiters = "\"\0";
ldns_buffer_skip(rd_buf, 1);
}
+
quoted = true;
}
/* because number of fields can be variable, we can't
rely on _maximum() only */
if ((c = ldns_bget_token(rd_buf, rd, delimiters,
- LDNS_MAX_RDFLEN)) != -1) {
+ LDNS_MAX_RDFLEN)) != -1) {
/* hmmz, rfc3597 specifies that any type can be represented with
* \# method, which can contain spaces...
* it does specify size though...