[sword-cvs] sword/src/mgr swconfig.cpp,1.11,1.12
sword@www.crosswire.org
sword@www.crosswire.org
Sat, 15 Feb 2003 19:42:59 -0700
Update of /usr/local/cvsroot/sword/src/mgr
In directory www:/tmp/cvs-serv18162/mgr
Modified Files:
swconfig.cpp
Log Message:
patch from Sami Liedes <sliedes at cc.hut.fi>
Index: swconfig.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/mgr/swconfig.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** swconfig.cpp 1 Oct 2002 22:04:59 -0000 1.11
--- swconfig.cpp 16 Feb 2003 02:42:56 -0000 1.12
***************
*** 40,43 ****
--- 40,44 ----
char retval = 0;
char buf[255];
+ int len;
line = "";
***************
*** 46,52 ****
while (buf[strlen(buf)-1] == '\n' || buf[strlen(buf)-1] == '\r')
buf[strlen(buf)-1] = 0;
! if (buf[strlen(buf)-1] == '\\') {
! buf[strlen(buf)-1] = 0;
line += buf;
continue;
--- 47,56 ----
while (buf[strlen(buf)-1] == '\n' || buf[strlen(buf)-1] == '\r')
buf[strlen(buf)-1] = 0;
+ len = strlen(buf);
+ while (len>0 && buf[len-1] == '\n' || buf[len-1] == '\r')
+ buf[(len--)-1] = 0;
! if (len>0 && buf[len-1] == '\\') {
! buf[(len--)-1] = 0;
line += buf;
continue;
***************
*** 54,58 ****
line += buf;
! if (strlen(buf) < 253) {
retval = 1;
break;
--- 58,62 ----
line += buf;
! if (len < 253) {
retval = 1;
break;