vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit efd4c311376ce49299fd718d65529870efcdd6af
parent bcda534f124136cbcf35dc5e2a05c82dfaac1f20
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Tue, 28 Jul 2015 18:06:46 +0200

vis: fix one more coverity scan warning

With the current code this will never cause a NULL dereference
since it is checked at the call site. However it makes sense
to check it anyway.

Diffstat:
Mvis.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vis.c b/vis.c @@ -1683,8 +1683,8 @@ static bool cmd_set(Filerange *range, enum CmdOpt cmdopt, const char *argv[]) { } static bool is_file_pattern(const char *pattern) { - return strcmp(pattern, ".") == 0 || strchr(pattern, '*') || - strchr(pattern, '[') || strchr(pattern, '{'); + return pattern && (strcmp(pattern, ".") == 0 || strchr(pattern, '*') || + strchr(pattern, '[') || strchr(pattern, '{')); } static const char *file_open_dialog(const char *pattern) {