Changeset 10976
- Timestamp:
- 06/16/07 12:01:22 (2 years ago)
- Files:
-
- trunk/midgard/httpd/apache2/midgard.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midgard/httpd/apache2/midgard.c
r10948 r10976 183 183 184 184 GList *list = NULL; 185 gchar *buf, *s; 186 gchar *duri = g_strdup(uri); 187 188 s = strtok_r((gchar *)duri, "/", &buf); 189 190 /* This is / request */ 185 guint i = 1; 186 187 gchar **s = g_strsplit(uri, "/", -1); 188 189 /* This is '/' request */ 191 190 if(!s) { 192 g_free(duri);193 191 return NULL; 194 192 } 195 193 196 194 /* prepend tokens , it's faster than append them */ 197 list = g_list_prepend(list, g_strdup(s)); 198 while((s = strtok_r(NULL, "/", &buf))) { 199 list = g_list_prepend(list, g_strdup(s)); 200 } 201 202 g_free(duri); 195 /* note that we start from 1 ( which is empty or null value before '/' ) */ 196 while(s[i] != NULL){ 197 198 list = g_list_prepend(list, g_strdup(s[i])); 199 i++; 200 } 201 202 g_strfreev(s); 203 203 204 204 /* Reverse tokens list to get correct order */
