libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcvd-members] gvars3/src GUI.cc


From: Colin Starr
Subject: [libcvd-members] gvars3/src GUI.cc
Date: Wed, 28 May 2008 16:42:53 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    gvars3
Changes by:     Colin Starr <ccs36>     08/05/28 16:42:53

Modified files:
        src            : GUI.cc 

Log message:
        When reading from a file, lines ending with a single backslash and then 
a newline are treated as continuing on the next line, in the manner of the C 
preprocessor. (No whitespace is allowed after the backslash.)
        If you already have lines ending in a backslash, this will break your 
program; however I hope this is very unlikely.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gvars3/src/GUI.cc?cvsroot=libcvd&r1=1.27&r2=1.28

Patches:
Index: GUI.cc
===================================================================
RCS file: /cvsroot/libcvd/gvars3/src/GUI.cc,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- GUI.cc      6 May 2008 23:02:55 -0000       1.27
+++ GUI.cc      28 May 2008 16:42:52 -0000      1.28
@@ -225,9 +225,17 @@
   void GUI_impl::ParseStream(istream& is)
   {
     string buffer;
-    while(getline(is, buffer))
+    while (getline(is, buffer)) {
+      // Lines ending with '\' are taken as continuing on the next line.
+      while(buffer[buffer.length() - 1] == '\\') {
+       string buffer2;
+       if (! getline(is, buffer2))
+         break;
+       buffer = buffer.substr(0, buffer.length() - 1) + buffer2;
+      }
       ParseLine(buffer);
   }
+  }
 
   void GUI_impl::LoadFile(string sFileName)
   {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]