Source-Changes-D archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/usr.bin/look
Am 23.02.12 23:57, schrieb Joerg Sonnenberger:
> Module Name: src
> Committed By: joerg
> Date: Thu Feb 23 22:57:53 UTC 2012
>
> Modified Files:
> src/usr.bin/look: look.c
>
> Log Message:
> Don't use while-loop with empty body.
I see you did several such changes. What is the reason behind this,
i.e. what is wrong with such loops?
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.15 -r1.16 src/usr.bin/look/look.c
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
>
>
>
>
> Modified files:
>
> Index: src/usr.bin/look/look.c
> diff -u src/usr.bin/look/look.c:1.15 src/usr.bin/look/look.c:1.16
> --- src/usr.bin/look/look.c:1.15 Sun Sep 4 20:29:32 2011
> +++ src/usr.bin/look/look.c Thu Feb 23 22:57:53 2012
> @@ -1,4 +1,4 @@
> -/* $NetBSD: look.c,v 1.15 2011/09/04 20:29:32 joerg Exp $ */
> +/* $NetBSD: look.c,v 1.16 2012/02/23 22:57:53 joerg Exp $ */
>
> /*-
> * Copyright (c) 1991, 1993
> @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
> #if 0
> static char sccsid[] = "@(#)look.c 8.2 (Berkeley) 5/4/95";
> #endif
> -__RCSID("$NetBSD: look.c,v 1.15 2011/09/04 20:29:32 joerg Exp $");
> +__RCSID("$NetBSD: look.c,v 1.16 2012/02/23 22:57:53 joerg Exp $");
> #endif /* not lint */
>
> /*
> @@ -218,7 +218,7 @@ look(char *string, char *front, char *ba
> * more trouble than it's worth.
> */
> #define SKIP_PAST_NEWLINE(p, back) \
> - while (p < back && *p++ != '\n');
> + while (p < back && *p++ != '\n') continue;
>
> static char *
> binary_search(char *string, char *front, char *back)
>
--
\~~~~~. The NetBSD Foundation
\~~~~~' Marc Balmer, Developer / Marketing
NetBSD
\ mbalmer%NetBSD.org@localhost http://www.NetBSD.org/
Home |
Main Index |
Thread Index |
Old Index