diff options
| author | Tom Schwindl <schwindl@posteo.de> | 2022-07-24 10:38:01 +0000 |
|---|---|---|
| committer | Felix Van der Jeugt <felix.vanderjeugt@posteo.net> | 2022-07-27 08:19:53 +0200 |
| commit | c9c01dc5b0586421569b7e3e24249020378b341c (patch) | |
| tree | e86619308484eb3ae238984a962fbb3d1d52560d | |
| parent | 7c22e881df5a4270ee0f1c112bda43e056949d88 (diff) | |
| download | vis-c9c01dc5b0586421569b7e3e24249020378b341c.tar.gz vis-c9c01dc5b0586421569b7e3e24249020378b341c.tar.xz | |
vis: Some duplicate files were overlooked due to a condition in the wrong place
| -rw-r--r-- | vis.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -196,11 +196,13 @@ static File *file_new(Vis *vis, const char *name) { File *existing = NULL; /* try to detect whether the same file is already open in another window */ - for (File *file = vis->files; file && file->name; file = file->next) { - if (cmp_names && strcmp(file->name, name_absolute) == 0 || - file->stat.st_dev == new.st_dev && file->stat.st_ino == new.st_ino) { - existing = file; - break; + for (File *file = vis->files; file; file = file->next) { + if (file->name) { + if (cmp_names && strcmp(file->name, name_absolute) == 0 || + file->stat.st_dev == new.st_dev && file->stat.st_ino == new.st_ino) { + existing = file; + break; + } } } if (existing) { |
