]> granicus.if.org Git - nethack/commitdiff
hacklib.c tidbit
authorPatR <rankin@nethack.org>
Fri, 15 Mar 2019 08:45:10 +0000 (01:45 -0700)
committerPatR <rankin@nethack.org>
Fri, 15 Mar 2019 08:45:10 +0000 (01:45 -0700)
Describe 'trimspaces()' more accurately.

src/hacklib.c

index 9a083e2fc1a68ca026d89519d948237f656a3eed..7cf5a47c69dab37e85070a751f2be09e00e6af3e 100644 (file)
@@ -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)
-chartxt;
+char *txt;
 {
-    charend;
+    char *end;
 
+    /* leading whitespace will remain in the buffer */
     while (*txt == ' ' || *txt == '\t')
         txt++;
     end = eos(txt);