Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Qmail-Scanner-Diagnostics: from rcpt-mqugw.biglobe.ne.jp by f.primenet.com.au (envelope-from <takimoto-j@kba.biglobe.ne.jp>, uid 7791) with qmail-scanner-2.11 
 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1.  
 Clear:RC:0(133.208.100.4):SA:0(-0.2/5.0):. 
 Processed in 0.131759 secs); 22 Aug 2016 10:11:42 -0000
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-0.2 required=5.0 tests=RP_MATCHES_RCVD,SPF_PASS
	autolearn=unavailable autolearn_force=no version=3.4.1
X-Envelope-From: takimoto-j@kba.biglobe.ne.jp
X-Qmail-Scanner-Mime-Attachments: |
X-Qmail-Scanner-Zip-Files: |
Received-SPF: pass (ns1.primenet.com.au: SPF record at spf01.biglobe.ne.jp designates 133.208.100.4 as permitted sender)
X-Biglobe-Sender: <takimoto-j@kba.biglobe.ne.jp>
From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Subject: [PATCH] fix 'conditionally uninitialized' variables
Message-Id: <8FC5A03A-E11B-47A0-B0F0-5DCDE7E6DAEE@kba.biglobe.ne.jp>
Date: Mon, 22 Aug 2016 18:27:06 +0900
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\))
X-Mailer: Apple Mail (2.1510)
X-Biglobe-Spnum: 55707
X-Seq: zsh-workers 39087

I tried 'clang -Wconditional-uninitialized' and it gave about 25 =
warnings.
I've looked into only some of them, and I believe most of them can be
(or should be) ignored. The following two, however, may be worth fixing.

In builtin.c, the variable 's' may (or may not) be assigned at line =
1480, but
using the value at line 1613 is meaningless. I guess this is just a =
typo.

utils.c is currently working fine because when NICEFLAG_QUOTE is set the
return value of mb_niceformat() is not used.


diff --git a/Src/builtin.c b/Src/builtin.c
index fb14b2e..da45300 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -1610,7 +1610,7 @@ bin_fc(char *nam, char **argv, Options ops, int =
func)
 		unqueue_signals();
 		if (fcedit(editor, fil)) {
 		    if (stuff(fil))
-			zwarnnam("fc", "%e: %s", errno, s);
+			zwarnnam("fc", "%e: %s", errno, fil);
 		    else {
 			loop(0,1);
 			retval =3D lastval;
diff --git a/Src/utils.c b/Src/utils.c
index 0a5954f..bdb614d 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -5080,8 +5080,10 @@ mb_niceformat(const char *s, FILE *stream, char =
**outstrp, int flags)
 	    cnt =3D 1;
 	    /* FALL THROUGH */
 	default:
-	    if (c =3D=3D L'\'' && (flags & NICEFLAG_QUOTE))
+	    if (c =3D=3D L'\'' && (flags & NICEFLAG_QUOTE)) {
 		fmt =3D "\\'";
+		newl =3D 2;
+	    }
 	    else
 		fmt =3D wcs_nicechar_sel(c, &newl, NULL, flags & =
NICEFLAG_QUOTE);
 	    break;

