comparison src/view_dir_tree.c @ 726:a1dcef8cd1ae

Use G_DIR_SEPARATOR where applicable.
author zas_
date Wed, 21 May 2008 11:07:23 +0000
parents eda074e91ddd
children 44128da39e13
comparison
equal deleted inserted replaced
725:eda074e91ddd 726:a1dcef8cd1ae
204 const gchar *strb, *strp; 204 const gchar *strb, *strp;
205 gint l; 205 gint l;
206 206
207 strp = path; 207 strp = path;
208 208
209 if (*strp != '/') return NULL; 209 if (*strp != G_DIR_SEPARATOR) return NULL;
210 210
211 strp++; 211 strp++;
212 strb = strp; 212 strb = strp;
213 l = 0; 213 l = 0;
214 214
215 while (*strp != '\0') 215 while (*strp != '\0')
216 { 216 {
217 if (*strp == '/') 217 if (*strp == G_DIR_SEPARATOR)
218 { 218 {
219 if (l > 0) list = g_list_prepend(list, g_strndup(strb, l)); 219 if (l > 0) list = g_list_prepend(list, g_strndup(strb, l));
220 strp++; 220 strp++;
221 strb = strp; 221 strb = strp;
222 l = 0; 222 l = 0;
463 strncmp(nd->fd->path, target_path, strlen(nd->fd->path)) == 0) 463 strncmp(nd->fd->path, target_path, strlen(nd->fd->path)) == 0)
464 { 464 {
465 gint n; 465 gint n;
466 466
467 n = strlen(nd->fd->path); 467 n = strlen(nd->fd->path);
468 if (target_path[n] == '/' && target_path[n+1] == '.') 468 if (target_path[n] == G_DIR_SEPARATOR && target_path[n+1] == '.')
469 { 469 {
470 gchar *name8; 470 gchar *name8;
471 struct stat sbuf; 471 struct stat sbuf;
472 472
473 n++; 473 n++;
474 474
475 while (target_path[n] != '\0' && target_path[n] != '/') n++; 475 while (target_path[n] != '\0' && target_path[n] != G_DIR_SEPARATOR) n++;
476 name8 = g_strndup(target_path, n); 476 name8 = g_strndup(target_path, n);
477 477
478 if (stat_utf8(name8, &sbuf)) 478 if (stat_utf8(name8, &sbuf))
479 { 479 {
480 list = g_list_prepend(list, file_data_new_simple(name8)); 480 list = g_list_prepend(list, file_data_new_simple(name8));