From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 18 14:04:22 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7252C16A4CE for ; Sun, 18 Jul 2004 14:04:22 +0000 (GMT) Received: from frodo.otenet.gr (frodo.otenet.gr [195.170.0.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 88A9243D53 for ; Sun, 18 Jul 2004 14:04:17 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-b180.otenet.gr [212.205.244.188]) by frodo.otenet.gr (8.12.10/8.12.10) with ESMTP id i6IE4E3E030055; Sun, 18 Jul 2004 17:04:15 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.12.11/8.12.11) with ESMTP id i6IE49sL095015; Sun, 18 Jul 2004 17:04:09 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.12.11/8.12.11/Submit) id i6IDtfBW077890; Sun, 18 Jul 2004 16:55:41 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Sun, 18 Jul 2004 16:55:41 +0300 From: Giorgos Keramidas To: Jos? de Paula Message-ID: <20040718135541.GA28115@gothmog.gr> References: <5ef8c2f004071419517bdc9f3e@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5ef8c2f004071419517bdc9f3e@mail.gmail.com> X-Mailman-Approved-At: Sun, 18 Jul 2004 14:25:21 +0000 cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] basic modelines for contrib/nvi X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jul 2004 14:04:22 -0000 On 2004-07-14 23:51, Jos? de Paula wrote: > I hacked together this little patch to contrib/nvi to make it support > simple modelines. [snip] > + > + if (O_ISSET(sp, O_MODELINE)) { > + cmd = get_modeline(sp); > + if (cmd != NULL) > + if (ex_run_str(sp, "modeline", cmd, strlen(cmd), 0, 0)) > + return; > + } > + Just a minor comment. Nested if's like the second & third above look like a natural place to use && as in: if (O_ISSET(sp, O_MODELINE)) { cmd = get_modeline(sp); if (cmd != NULL && ex_run_str(sp, "modeline", cmd, strlen(cmd), 0, 0)) return; } Giorgos