Skip to content

Commit

Permalink
Bug fix: Remote view:filename command
Browse files Browse the repository at this point in the history
The command:
geeqie -r view:filename
crashes Geeqie if the filename is not preceeded by a path.

Use a string function that handles nulls.
  • Loading branch information
Colin Clark committed Mar 17, 2017
1 parent f12204d commit f470e79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/view_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ void vf_notify_cb(FileData *fd, NotifyType type, gpointer data)
if (!refresh)
{
gchar *base = remove_level_from_path(fd->path);
refresh = (strcmp(base, vf->dir_fd->path) == 0);
refresh = (g_strcmp0(base, vf->dir_fd->path) == 0);
g_free(base);
}

Expand All @@ -1092,14 +1092,14 @@ void vf_notify_cb(FileData *fd, NotifyType type, gpointer data)
if (!refresh && fd->change->dest)
{
gchar *dest_base = remove_level_from_path(fd->change->dest);
refresh = (strcmp(dest_base, vf->dir_fd->path) == 0);
refresh = (g_strcmp0(dest_base, vf->dir_fd->path) == 0);
g_free(dest_base);
}

if (!refresh && fd->change->source)
{
gchar *source_base = remove_level_from_path(fd->change->source);
refresh = (strcmp(source_base, vf->dir_fd->path) == 0);
refresh = (g_strcmp0(source_base, vf->dir_fd->path) == 0);
g_free(source_base);
}
}
Expand Down

0 comments on commit f470e79

Please sign in to comment.