/*
- * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
+ * Copyright (C) 2005-2009 Atsushi Konno All rights reserved.
* Copyright (C) 2005 QSDN,Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
char *name;
char *value;
Attr *attr;
- int use_quote;
+ int use_quote_sq;
+ int use_quote_dq;
int backslash;
if (! doc) {
return NULL;
}
if (! s) return NULL;
- use_quote = 0;
+
+ use_quote_sq = 0;
+ use_quote_dq = 0;
backslash = 0;
QX_LOGGER_DEBUG("start qs_parse_attr()");
backslash = 1;
break;
}
- if (s[ii] == '\'' || s[ii] == '"') {
- use_quote = 1;
+ if (s[ii] == '\'') {
+ use_quote_sq = 1;
+ ii++;
+ break;
+ }
+ if (s[ii] == '"') {
+ use_quote_dq = 1;
ii++;
break;
}
continue;
if (is_white_space(s[ii])) {
- if (! use_quote)
+ if (! use_quote_sq && ! use_quote_dq)
break;
}
continue;
}
- if (s[ii] == '"')
+ if (s[ii] == '"' && use_quote_dq)
break;
- if (s[ii] == '\'')
+ if (s[ii] == '\'' && use_quote_sq)
break;
}
size = ii - start_pos;