From ed55fa23f6f4ba478b8fd67651d287fb655d43d8 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 15 Mar 2019 01:45:10 -0700 Subject: [PATCH] hacklib.c tidbit Describe 'trimspaces()' more accurately. --- src/hacklib.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/hacklib.c b/src/hacklib.c index 9a083e2fc..7cf5a47c6 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 hacklib.c $NHDT-Date: 1518922474 2018/02/18 02:54:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.54 $ */ +/* NetHack 3.6 hacklib.c $NHDT-Date: 1552639487 2019/03/15 08:44:47 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.67 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2007. */ /* Copyright (c) Robert Patrick Rankin, 1991 */ @@ -170,13 +170,14 @@ char *bp; return bp; } -/* remove leading and trailing whitespace, in place */ -char* +/* skip leading whitespace; remove trailing whitespace, in place */ +char * trimspaces(txt) -char* txt; +char *txt; { - char* end; + char *end; + /* leading whitespace will remain in the buffer */ while (*txt == ' ' || *txt == '\t') txt++; end = eos(txt); -- 2.49.0