Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: $(<nofile) doesn't set $? to non-zero
- X-seq: zsh-workers 42468
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: $(<nofile) doesn't set $? to non-zero
- Date: Thu, 15 Mar 2018 11:10:14 +0000
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=TbzArHjADhEXYhgHFTg1cKeR1jX/y0HxIxU8ga6K+Oo=; b=JVOik9fcMprIHeFoKOqbd6H9hsDwTCtrRdWwY3r88jG7Q/709A0+KW/iSzF9GA+Ful qIdayrKRzkTwlOub34ySjv6woKcUPsFz43JVWGlj6dGDXIpeLX1mO3z7dsvWBakq9nHH DOak/5laKUarMcDoa1d8H4wZwsX6dQFi6dQQgM51lga6ddxT1pK+6RlRys8s3BBwsNy1 fzQzoeKIMmCnMVEOFa6EgoDYJLD9ZqttWyKSYTCiSoxw9xNYKkV4bo8x2q5urcC0BauB fqNPiMkken46rTfv36HgvBjApkRygAP6+3i3kblCpV50Wkm9LesHUb9btzjNcdjFi5yG Xvwg==
- In-reply-to: <20180315092305.6fe4ad17@camnpupstephen>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: Peter Stephenson <p.stephenson@xxxxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CGME20180314103335epcas4p30222f0df02adda27cbddbe62075ff9ad@epcas4p3.samsung.com> <20180314103254.GA10404@chaz.gmail.com> <20180314105442.28c5554a@camnpupstephen> <20180314144248.GC10404@chaz.gmail.com> <20180314145004.6e4b971b@camnpupstephen> <20180315071204.GA10057@chaz.gmail.com> <20180315092305.6fe4ad17@camnpupstephen>
2018-03-15 09:23:05 +0000, Peter Stephenson:
[...]
> That should be more consistent, thanks. I've committed it (minor
> tweaks).
[...]
Sorry, my bad, I've left an unused variable in the patch.
diff --git a/Src/Modules/mapfile.c b/Src/Modules/mapfile.c
index 771e5b5fc..7a903418f 100644
--- a/Src/Modules/mapfile.c
+++ b/Src/Modules/mapfile.c
@@ -197,9 +197,8 @@ get_contents(char *fname)
val = NULL;
if ((fd = open(fname, O_RDONLY | O_NOCTTY)) >= 0) {
LinkList ll;
- int readerror;
- if ((ll = readoutput(fd, 1, &readerror)))
+ if ((ll = readoutput(fd, 1, 0)))
val = peekfirst(ll);
}
#endif /* USE_MMAP */
I initially thought it would be nice to report errors when the
file cannot be read in $mapfile[file], but then gave up on it on
the ground that it was not done with mmap().
Now maybe it would make sense to report errors other than ENOENT
here (even for the open)?
But then that could become annoying for things like
(($+mapfile[somefile])) (not that people should use that).
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author