comparison src/alias.c @ 14:a8f3424347dc

replaced number 0 with character \0 where appropriate
author meillo@marmaro.de
date Wed, 29 Oct 2008 21:21:26 +0100
parents 26e34ae9a3e3
children a80ebfa16cd5
comparison
equal deleted inserted replaced
13:49dab67fe461 14:a8f3424347dc
65 GList *list = NULL; 65 GList *list = NULL;
66 gchar buf[256]; 66 gchar buf[256];
67 gchar *p, *q; 67 gchar *p, *q;
68 68
69 p = line; 69 p = line;
70 while (*p != 0) { 70 while (*p != '\0') {
71 q = buf; 71 q = buf;
72 while (isspace(*p)) 72 while (isspace(*p))
73 p++; 73 p++;
74 if (*p != '\"') { 74 if (*p != '\"') {
75 while (*p && (*p != ',') && (q < buf + 255)) 75 while (*p && (*p != ',') && (q < buf + 255))
76 *(q++) = *(p++); 76 *(q++) = *(p++);
77 *q = 0; 77 *q = '\0';
78 } else { 78 } else {
79 gboolean escape = FALSE; 79 gboolean escape = FALSE;
80 p++; 80 p++;
81 while (*p && (*p != '\"' || escape) && (q < buf + 255)) { 81 while (*p && (*p != '\"' || escape) && (q < buf + 255)) {
82 if ((*p == '\\') && !escape) 82 if ((*p == '\\') && !escape)
85 escape = FALSE; 85 escape = FALSE;
86 *(q++) = *p; 86 *(q++) = *p;
87 } 87 }
88 p++; 88 p++;
89 } 89 }
90 *q = 0; 90 *q = '\0';
91 while (*p && (*p != ',')) 91 while (*p && (*p != ','))
92 p++; 92 p++;
93 } 93 }
94 list = g_list_append(list, g_strdup(g_strchomp(buf))); 94 list = g_list_append(list, g_strdup(g_strchomp(buf)));
95 if (*p) 95 if (*p)