[cvslog] (2004-02-25 23:08:22 UTC) Module eggdrop1.6: Change committed

cvslog cvs at tsss.org
Wed Feb 25 17:08:22 CST 2004


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2004-02-25 23:08:22 UTC
Commited by: stdarg <stdarg at techmonkeys.org>

Modified files:
     src/chanprog.c

Log message:

* rmspace workaround for constant arguments

---------------------- diff included ----------------------
Index: eggdrop1.6/src/chanprog.c
diff -u eggdrop1.6/src/chanprog.c:1.49 eggdrop1.6/src/chanprog.c:1.50
--- eggdrop1.6/src/chanprog.c:1.49	Mon Feb  9 20:10:50 2004
+++ eggdrop1.6/src/chanprog.c	Wed Feb 25 17:08:12 2004
@@ -7,7 +7,7 @@
  *   telling the current programmed settings
  *   initializing a lot of stuff and loading the tcl scripts
  *
- * $Id: chanprog.c,v 1.49 2004/02/10 02:10:50 wcc Exp $
+ * $Id: chanprog.c,v 1.50 2004/02/25 23:08:12 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -66,16 +66,17 @@
 void rmspace(char *s)
 {
 #define whitespace(c) (((c) == 32) || ((c) == 9) || ((c) == 13) || ((c) == 10))
-  char *p;
+  char *p, *end;
   int len;
 
   if (!*s)
     return;
 
   /* Wipe end of string */
-  for (p = s + strlen(s) - 1; ((whitespace(*p)) && (p >= s)); p--);
-  *(p + 1) = 0;
-  len = p + 1 - s;
+  end = s + strlen(s) - 1;
+  for (p = end; ((whitespace(*p)) && (p >= s)); p--);
+  if (p != end) *(p + 1) = 0;
+  len = p+1 - s;
   for (p = s; ((whitespace(*p)) && (*p)); p++);
   len -= (p - s);
   if (p != s) {
----------------------- End of diff -----------------------



More information about the Changes mailing list