GtkListStore *store;
gchar *pathl;
- if(!path) return;
+ if (!path) return;
pathl = path_from_utf8(path);
dp = opendir(pathl);
gchar *buf;
path = gtk_entry_get_text(GTK_ENTRY(dd->entry));
- if (strcmp(path, dd->path) == 0) return;
+ if (dd->path && strcmp(path, dd->path) == 0) return;
buf = remove_level_from_path(path);
- if (buf && strcmp(buf, dd->path) != 0)
+ if (buf && (!dd->path || strcmp(buf, dd->path) != 0))
{
gchar *tmp = remove_trailing_slash(path);
if (isdir(tmp))
path = gtk_entry_get_text(GTK_ENTRY(entry));
- if (isdir(path) && strcmp(path, dd->path) != 0)
+ if (isdir(path) && (!dd->path || strcmp(path, dd->path) != 0))
{
dest_populate(dd, path);
}
else
{
gchar *buf = remove_level_from_path(path);
- if (isdir(buf) && strcmp(buf, dd->path) != 0)
+ if (isdir(buf) && (!dd->path || strcmp(buf, dd->path) != 0))
{
dest_populate(dd, buf);
}