- for (pi = str; *pi && *pi != '\n'; pi++) {
- if (*pi == '\\') { /* escape */
- pi++;
- if (*pi >= '0' && *pi <= '3') {
- *po = ((*pi++ - '0') << 6);
- *po = *po + ((*pi++ - '0') << 3);
- *po = *po + ((*pi - '0') );
- }
- else *po = *pi;
- po++;
- }
- else if (*pi == '"') { /* quotes */
- in_quotes = !in_quotes;
- }
- else if (!in_quotes && strchr(sep, *pi)) { /* separator */
+ for (pi = str; *pi && *pi != '\0'; pi++) {
+ if (*pi == '\n' && !in_quotes)
+ break;
+
+ if (!in_quotes && strchr(sep, *pi)) {
+ /*
+ * separator
+ * Advance to next field.
+ */