|
|
c6dbd9 |
From 3925a4fbed618504f49e2a8a5551cc5800d9353b Mon Sep 17 00:00:00 2001
|
|
|
c6dbd9 |
From: Peter Stephenson <pws@zsh.org>
|
|
|
c6dbd9 |
Date: Mon, 25 Jan 2016 15:43:06 +0000
|
|
|
c6dbd9 |
Subject: [PATCH 1/2] 37776: Set errflag before calls to zwarning().
|
|
|
c6dbd9 |
|
|
|
c6dbd9 |
This avoids an attempt to call zerr() or zerrnam() recusrively.
|
|
|
c6dbd9 |
|
|
|
c6dbd9 |
Upstream-commit: be32864e6ff6a872d63314b4baedbfbf2eed54bd
|
|
|
c6dbd9 |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
c6dbd9 |
---
|
|
|
c6dbd9 |
Src/utils.c | 4 ++--
|
|
|
c6dbd9 |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
c6dbd9 |
|
|
|
c6dbd9 |
diff --git a/Src/utils.c b/Src/utils.c
|
|
|
c6dbd9 |
index 4640970..9ce3ee9 100644
|
|
|
c6dbd9 |
--- a/Src/utils.c
|
|
|
c6dbd9 |
+++ b/Src/utils.c
|
|
|
c6dbd9 |
@@ -156,12 +156,12 @@ VA_DCL
|
|
|
c6dbd9 |
errflag = 1;
|
|
|
c6dbd9 |
return;
|
|
|
c6dbd9 |
}
|
|
|
c6dbd9 |
+ errflag = 1;
|
|
|
c6dbd9 |
|
|
|
c6dbd9 |
VA_START(ap, fmt);
|
|
|
c6dbd9 |
VA_GET_ARG(ap, fmt, const char *);
|
|
|
c6dbd9 |
zwarning(NULL, fmt, ap);
|
|
|
c6dbd9 |
va_end(ap);
|
|
|
c6dbd9 |
- errflag = 1;
|
|
|
c6dbd9 |
}
|
|
|
c6dbd9 |
|
|
|
c6dbd9 |
/**/
|
|
|
c6dbd9 |
@@ -175,13 +175,13 @@ VA_DCL
|
|
|
c6dbd9 |
|
|
|
c6dbd9 |
if (errflag || noerrs)
|
|
|
c6dbd9 |
return;
|
|
|
c6dbd9 |
+ errflag = 1;
|
|
|
c6dbd9 |
|
|
|
c6dbd9 |
VA_START(ap, fmt);
|
|
|
c6dbd9 |
VA_GET_ARG(ap, cmd, const char *);
|
|
|
c6dbd9 |
VA_GET_ARG(ap, fmt, const char *);
|
|
|
c6dbd9 |
zwarning(cmd, fmt, ap);
|
|
|
c6dbd9 |
va_end(ap);
|
|
|
c6dbd9 |
- errflag = 1;
|
|
|
c6dbd9 |
}
|
|
|
c6dbd9 |
|
|
|
c6dbd9 |
/**/
|
|
|
c6dbd9 |
--
|
|
|
c6dbd9 |
2.5.0
|
|
|
c6dbd9 |
|
|
|
c6dbd9 |
|
|
|
c6dbd9 |
From 7a028030cfdcd85b61950e4a530442ebff359f4c Mon Sep 17 00:00:00 2001
|
|
|
c6dbd9 |
From: Kamil Dudka <kdudka@redhat.com>
|
|
|
c6dbd9 |
Date: Mon, 25 Jan 2016 18:01:07 +0100
|
|
|
c6dbd9 |
Subject: [PATCH 2/2] 37780: Care printing error if nothing to print.
|
|
|
c6dbd9 |
|
|
|
c6dbd9 |
Upstream-commit: 69c86cd2c3f1533d9b4b345f98d3922418bc6dac
|
|
|
c6dbd9 |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
c6dbd9 |
---
|
|
|
c6dbd9 |
Src/utils.c | 7 ++++---
|
|
|
c6dbd9 |
1 file changed, 4 insertions(+), 3 deletions(-)
|
|
|
c6dbd9 |
|
|
|
c6dbd9 |
diff --git a/Src/utils.c b/Src/utils.c
|
|
|
c6dbd9 |
index 9ce3ee9..bb3c241 100644
|
|
|
c6dbd9 |
--- a/Src/utils.c
|
|
|
c6dbd9 |
+++ b/Src/utils.c
|
|
|
c6dbd9 |
@@ -120,9 +120,11 @@ zwarning(const char *cmd, const char *fmt, va_list ap)
|
|
|
c6dbd9 |
if (isatty(2))
|
|
|
c6dbd9 |
zleentry(ZLE_CMD_TRASH);
|
|
|
c6dbd9 |
|
|
|
c6dbd9 |
+ char *prefix = scriptname ? scriptname : (argzero ? argzero : "");
|
|
|
c6dbd9 |
+
|
|
|
c6dbd9 |
if (cmd) {
|
|
|
c6dbd9 |
if (unset(SHINSTDIN) || locallevel) {
|
|
|
c6dbd9 |
- nicezputs(scriptname ? scriptname : argzero, stderr);
|
|
|
c6dbd9 |
+ nicezputs(prefix, stderr);
|
|
|
c6dbd9 |
fputc((unsigned char)':', stderr);
|
|
|
c6dbd9 |
}
|
|
|
c6dbd9 |
nicezputs(cmd, stderr);
|
|
|
c6dbd9 |
@@ -134,8 +136,7 @@ zwarning(const char *cmd, const char *fmt, va_list ap)
|
|
|
c6dbd9 |
* program/script is running. It's also set in shell functions,
|
|
|
c6dbd9 |
* so test locallevel, too.
|
|
|
c6dbd9 |
*/
|
|
|
c6dbd9 |
- nicezputs((isset(SHINSTDIN) && !locallevel) ? "zsh" :
|
|
|
c6dbd9 |
- scriptname ? scriptname : argzero, stderr);
|
|
|
c6dbd9 |
+ nicezputs((isset(SHINSTDIN) && !locallevel) ? "zsh" : prefix, stderr);
|
|
|
c6dbd9 |
fputc((unsigned char)':', stderr);
|
|
|
c6dbd9 |
}
|
|
|
c6dbd9 |
|
|
|
c6dbd9 |
--
|
|
|
c6dbd9 |
2.5.0
|
|
|
c6dbd9 |
|