Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH 16/17: compctl: Comparing array with 0 does nothing, check contents (should it be dropped instead?)
- X-seq: zsh-workers 34120
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH 16/17: compctl: Comparing array with 0 does nothing, check contents (should it be dropped instead?)
- Date: Tue, 6 Jan 2015 06:25:48 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=XSvYHU2STL42/vQliQcD2Xr5JjUfKx0KAylRfrP+T4w=; b=WVgb/Gq1C6I6NjwBkzMv6VZjBEqdFGqQ7xAXC2g+fg5T3PVFpgdIRBMnJzY7aXwPMb 3j14LVZfTjiNlk7F5lgeN21Od0ZdleOxwUq7jiyTel1oaHlsSOgOxlZgEkgtEJeKOBR3 Ebz4BCj0hiTZ4ThMdHQwrMVeXy2wUZyF4E0uB1Z9c0Aixy/2FXfvFr/0sZR1B/A4yJ1u kRtL6b9rU3AInJ8lxIGOqSYQVc2Y8MSHsXZ8qlKPFFzVK83pv2wCZyRAl7NHtB3P6l7O UFwUwn1/mlmgIIUK8YfEDroaj9DbyJxBQOwhPyDo+X49/nBv7gqVlrh3Tvz+BU0NZooA vLcQ==
- In-reply-to: <1420521949-30483-1-git-send-email-mikachu@gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1420521949-30483-1-git-send-email-mikachu@gmail.com>
Found by Coverity (Issue 1255780).
---
Src/Zle/compctl.c | 2 +-
Src/jobs.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c
index 96ad6a2..2a80e6c 100644
--- a/Src/Zle/compctl.c
+++ b/Src/Zle/compctl.c
@@ -3685,7 +3685,7 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
for (i = 0; i <= maxjob; i++)
if ((jobtab[i].stat & STAT_INUSE) &&
- jobtab[i].procs && jobtab[i].procs->text) {
+ jobtab[i].procs && jobtab[i].procs->text[0]) {
int stopped = jobtab[i].stat & STAT_STOPPED;
j = dupstring(jobtab[i].procs->text);
diff --git a/Src/jobs.c b/Src/jobs.c
index c6e1bce..295f4c9 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -2718,7 +2718,7 @@ findjobnam(const char *s)
for (jobnum = maxjob; jobnum >= 0; jobnum--)
if (!(jobtab[jobnum].stat & (STAT_SUBJOB | STAT_NOPRINT)) &&
jobtab[jobnum].stat && jobtab[jobnum].procs && jobnum != thisjob &&
- jobtab[jobnum].procs->text && strpfx(s, jobtab[jobnum].procs->text))
+ jobtab[jobnum].procs->text[0] && strpfx(s, jobtab[jobnum].procs->text))
return jobnum;
return -1;
}
--
2.2.0.GIT
Messages sorted by:
Reverse Date,
Date,
Thread,
Author