From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 30 Mar 2011 01:51:39 +0400 From: "Dmitry V. Levin" To: Linux console tools development discussion Message-ID: <20110329215138.GE28581@altlinux.org> References: <20110321214236.GA13370@graeme> <4D8C9693.9040006@gmail.com> <20110326223322.GA21591@altlinux.org> <4D8F0463.1050207@gmail.com> <20110328111918.GC15694@altlinux.org> <4D90F890.9000703@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FN+gV9K+162wdwwF" Content-Disposition: inline In-Reply-To: <4D90F890.9000703@gmail.com> X-fingerprint: FE4C 93AB E19A 2E4C CB5D 3E4E 7CAB E6AC 9E35 361E Subject: Re: [kbd] New vt_mode tool for kbd? X-BeenThere: kbd@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Linux console tools development discussion List-Id: Linux console tools development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2011 21:51:40 -0000 Archived-At: List-Archive: --FN+gV9K+162wdwwF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 29, 2011 at 01:07:28AM +0400, Alexey Gladkov wrote: > 28.03.2011 15:19, Dmitry V. Levin wrote: > > This interface would be both script-friendly and extensible. >=20 > Ok. Another implementation. How about this ? Fine with me. > static int > answer(char *ans) { I'd change this and some others "char *" to "const char *", but it's not important. > return !strcasecmp(value, ans) ? EXIT_SUCCESS : EXIT_FAILURE; I'd code it a bit differently: return strcasecmp(value, ans) ? EXIT_FAILURE : EXIT_SUCCESS; --=20 ldv --FN+gV9K+162wdwwF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAk2SVGoACgkQfKvmrJ41Nh6F3ACfT1wFOaEHgINID4HEJPevPbW3 kpsAn3nIAMV+NMoiBCFtbriEvgZ9QN1e =XZke -----END PGP SIGNATURE----- --FN+gV9K+162wdwwF--