while (p[0] != '\0')
{
p++;
- if (p[0] == '/' || p[0] == '\0')
+ if (p[0] == G_DIR_SEPARATOR || p[0] == '\0')
{
gint end = TRUE;
if (p[0] != '\0')
return FALSE;
}
}
- if (!end) p[0] = '/';
+ if (!end) p[0] = G_DIR_SEPARATOR;
}
}
}
if (!flush)
changed |= collect_manager_process_action(entry, &buf);
- valid = (buf[0] == '/' && collection_add_check(cd, file_data_new_simple(buf), FALSE, TRUE));
+ valid = (buf[0] == G_DIR_SEPARATOR && collection_add_check(cd, file_data_new_simple(buf), FALSE, TRUE));
if (!valid) DEBUG_1("collection invalid file: %s", buf);
g_free(buf);
collection_set_update_info_func(cw->cd, collection_window_update_info, cw);
- if (path && *path == '/') collection_load_begin(cw->cd, NULL, COLLECTION_LOAD_NONE);
+ if (path && *path == G_DIR_SEPARATOR) collection_load_begin(cw->cd, NULL, COLLECTION_LOAD_NONE);
return cw;
}
if ((!lw->path || strcmp(lw->path, buf) != 0) && layout_set_path(lw, buf))
{
gint pos = -1;
- /* put the '/' back, if we are in tab completion for a dir and result was path change */
+ /* put the G_DIR_SEPARATOR back, if we are in tab completion for a dir and result was path change */
gtk_editable_insert_text(GTK_EDITABLE(lw->path_entry), G_DIR_SEPARATOR_S, -1, &pos);
gtk_editable_set_position(GTK_EDITABLE(lw->path_entry),
strlen(gtk_entry_get_text(GTK_ENTRY(lw->path_entry))));
const gchar *cmd_line = argv[i];
gchar *cmd_all = g_build_filename(base_dir, cmd_line, NULL);
- if (cmd_line[0] == '/' && isdir(cmd_line))
+ if (cmd_line[0] == G_DIR_SEPARATOR && isdir(cmd_line))
{
parse_command_line_process_dir(cmd_line, path, file, &list, &first_dir);
}
{
parse_command_line_process_dir(cmd_all, path, file, &list, &first_dir);
}
- else if (cmd_line[0] == '/' && isfile(cmd_line))
+ else if (cmd_line[0] == G_DIR_SEPARATOR && isfile(cmd_line))
{
parse_command_line_process_file(cmd_line, path, file,
&list, collection_list, &first_dir);
{
gint match = FALSE;
- if (path[0] == '/')
+ if (path[0] == G_DIR_SEPARATOR)
{
if (pi->fd->path && strcmp(path, pi->fd->path) == 0) match = TRUE;
}
GList *list = NULL;
if (!path) return NULL;
- if (partial && path[0] == '/') return NULL;
+ if (partial && path[0] == G_DIR_SEPARATOR) return NULL;
list = pan_item_find_by_path_l(list, pw->list_static, type, path, ignore_case, partial);
list = pan_item_find_by_path_l(list, pw->list, type, path, ignore_case, partial);
parse_out_relatives(sl);
- if (buf[0] == '/')
+ if (buf[0] == G_DIR_SEPARATOR)
{
if (strncmp(sl, buf, l) == 0 &&
- (sl[l] == '\0' || sl[l] == '/' || l == 1)) ret = TRUE;
+ (sl[l] == '\0' || sl[l] == G_DIR_SEPARATOR || l == 1)) ret = TRUE;
}
else
{
parse_out_relatives(link_path);
if (strncmp(sl, link_path, l) == 0 &&
- (sl[l] == '\0' || sl[l] == '/' || l == 1)) ret = TRUE;
+ (sl[l] == '\0' || sl[l] == G_DIR_SEPARATOR || l == 1)) ret = TRUE;
g_free(link_path);
}
image_scroll_to_point(pw->imd, pi->x + pi->width / 2, pi->y + pi->height / 2, 0.5, 0.5);
buf = g_strdup_printf("%s ( %d / %d )",
- (path[0] == '/') ? _("path found") : _("filename found"),
+ (path[0] == G_DIR_SEPARATOR) ? _("path found") : _("filename found"),
g_list_index(list, pi) + 1,
g_list_length(list));
pan_search_status(pw, buf);
&& dir->d_name[0] == '.' && dir->d_name[1] == '\0')
continue;
if (dir->d_name[0] == '.' && dir->d_name[1] == '.' && dir->d_name[2] == '\0'
- && pathl[0] == '/' && pathl[1] == '\0')
+ && pathl[0] == G_DIR_SEPARATOR && pathl[1] == '\0')
continue; /* no .. for root directory */
if (dd->show_hidden || !is_hidden(dir->d_name))
{
dd->filter = g_strdup(gtk_entry_get_text(GTK_ENTRY(GTK_BIN(dd->filter_combo)->child)));
}
- if (path && path[0] == '/' && isdir(path))
+ if (path && path[0] == G_DIR_SEPARATOR && isdir(path))
{
dest_populate(dd, path);
}
/* ----------------------------------------------------------------
Tab completion routines, can be connected to any gtkentry widget
using the tab_completion_add_to_entry() function.
- Use remove_trailing_slash() to strip the trailing '/'.
+ Use remove_trailing_slash() to strip the trailing G_DIR_SEPARATOR.
----------------------------------------------------------------*/
typedef struct _TabCompData TabCompData;
if (!path) return NULL;
l = strlen(path);
- while (l > 1 && path[l - 1] == '/') l--;
+ while (l > 1 && path[l - 1] == G_DIR_SEPARATOR) l--;
return g_strndup(path, l);
}
generic_dialog_attach_default(GENERIC_DIALOG(fdlg), fdlg->entry);
gtk_widget_show(tabcomp);
- if (path && path[0] == '/')
+ if (path && path[0] == G_DIR_SEPARATOR)
{
fdlg->dest_path = g_strdup(path);
}
return;
}
- if (!fdlg->dest_path || fdlg->dest_path[0] != '/')
+ if (!fdlg->dest_path || fdlg->dest_path[0] != G_DIR_SEPARATOR)
{
if (fdlg->source_fd)
{
if (strlen(name) == 0) return;
- if (name[0] == '/')
+ if (name[0] == G_DIR_SEPARATOR)
{
gchar *buf;
buf = remove_level_from_path(name);
strp = path;
- if (*strp != '/') return NULL;
+ if (*strp != G_DIR_SEPARATOR) return NULL;
strp++;
strb = strp;
while (*strp != '\0')
{
- if (*strp == '/')
+ if (*strp == G_DIR_SEPARATOR)
{
if (l > 0) list = g_list_prepend(list, g_strndup(strb, l));
strp++;
gint n;
n = strlen(nd->fd->path);
- if (target_path[n] == '/' && target_path[n+1] == '.')
+ if (target_path[n] == G_DIR_SEPARATOR && target_path[n+1] == '.')
{
gchar *name8;
struct stat sbuf;
n++;
- while (target_path[n] != '\0' && target_path[n] != '/') n++;
+ while (target_path[n] != '\0' && target_path[n] != G_DIR_SEPARATOR) n++;
name8 = g_strndup(target_path, n);
if (stat_utf8(name8, &sbuf))
old_path = g_build_filename(vf->path, old, NULL);
new_path = g_build_filename(vf->path, new, NULL);
- if (strchr(new, '/') != NULL)
+ if (strchr(new, G_DIR_SEPARATOR) != NULL)
{
gchar *text = g_strdup_printf(_("Invalid file name:\n%s"), new);
file_util_warning_dialog(_("Error renaming file"), text, GTK_STOCK_DIALOG_ERROR, vf->listview);