diff options
author | 2017-01-09 19:29:12 +0000 | |
---|---|---|
committer | 2017-01-09 19:29:12 +0000 | |
commit | 147fa935e410a903fae26e322842bdd1738afe2b (patch) | |
tree | 4a6714e2abc21b1624395de5a13a7002d20c9b1e /usr.bin/tmux/cmd-source-file.c | |
parent | Run the source-file pattern through glob(3). (diff) | |
download | wireguard-openbsd-147fa935e410a903fae26e322842bdd1738afe2b.tar.xz wireguard-openbsd-147fa935e410a903fae26e322842bdd1738afe2b.zip |
source-file -q needs to apply to glob(3) too.
Diffstat (limited to 'usr.bin/tmux/cmd-source-file.c')
-rw-r--r-- | usr.bin/tmux/cmd-source-file.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-source-file.c b/usr.bin/tmux/cmd-source-file.c index bfac10a6ddc..8863610df02 100644 --- a/usr.bin/tmux/cmd-source-file.c +++ b/usr.bin/tmux/cmd-source-file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-source-file.c,v 1.31 2017/01/09 19:27:00 nicm Exp $ */ +/* $OpenBSD: cmd-source-file.c,v 1.32 2017/01/09 19:29:12 nicm Exp $ */ /* * Copyright (c) 2008 Tiago Cunha <me@tiagocunha.org> @@ -55,11 +55,13 @@ cmd_source_file_exec(struct cmd *self, struct cmdq_item *item) glob_t g; int i; + quiet = args_has(args, 'q'); if (glob(args->argv[0], 0, NULL, &g) != 0) { + if (quiet && errno == ENOENT) + return (CMD_RETURN_NORMAL); cmdq_error(item, "%s: %s", args->argv[0], strerror(errno)); return (CMD_RETURN_ERROR); } - quiet = args_has(args, 'q'); retval = CMD_RETURN_NORMAL; for (i = 0; i < g.gl_pathc; i++) { |