[sword-svn] r2069 - trunk/include

scribe at www.crosswire.org scribe at www.crosswire.org
Fri Aug 31 00:21:10 MST 2007


Author: scribe
Date: 2007-08-31 00:21:09 -0700 (Fri, 31 Aug 2007)
New Revision: 2069

Modified:
   trunk/include/swbuf.h
Log:
fixed a bug in operator << which prevented size 1 buf from going to size 0
which in turn fixed a trim bug which would hang on buf entirely of whitespace


Modified: trunk/include/swbuf.h
===================================================================
--- trunk/include/swbuf.h	2007-08-31 06:40:23 UTC (rev 2068)
+++ trunk/include/swbuf.h	2007-08-31 07:21:09 UTC (rev 2069)
@@ -320,7 +320,7 @@
 	inline SWBuf &operator -=(unsigned long len) { setSize(length()-len); return *this; }
 	inline SWBuf &operator --(int) { operator -=(1); return *this; }
 
-	inline SWBuf &operator <<(unsigned long n) { n = (n<length())?n:(length()-1); memmove(buf, buf+n, length()-n); (*this)-=n; return *this; }
+	inline SWBuf &operator <<(unsigned long n) { n = (n<=length())?n:(length()-1); memmove(buf, buf+n, length()-n); (*this)-=n; return *this; }
 	inline SWBuf &operator >>(unsigned long n) { setSize(length()+n); memmove(buf+n, buf, length()-n); return *this; }
 	inline SWBuf operator +(const SWBuf &other) const {
 		SWBuf retVal = buf;




More information about the sword-cvs mailing list