Update of /cvsroot/mahogany/M/src/util
In directory sc8-pr-cvs1:/tmp/cvs-serv4460/src/util

Modified Files:
        strutil.cpp 
Log Message:
CRLF fix and font fix for minimal editor

Index: strutil.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/util/strutil.cpp,v
retrieving revision 1.112
retrieving revision 1.113
diff -b -u -2 -r1.112 -r1.113
--- strutil.cpp 22 Jul 2003 22:01:42 -0000      1.112
+++ strutil.cpp 1 Sep 2003 15:35:31 -0000       1.113
@@ -546,4 +546,42 @@
 
 
+/** Enforces LF '\n' newline convention.
+
+    @param in string to copy
+    @return the UNIXified string
+*/
+String
+strutil_enforceLF(String const &in)
+{
+   String out;
+   size_t cursor = 0;
+   
+   while ( cursor < in.size() )
+   {
+      wxChar one = in[cursor];
+      if ( one != _T('\r') )
+      {
+         out += one;
+         cursor++;
+      }
+      else
+      {
+         out += '\n';
+         if ( cursor + 1 < in.size() )
+         {
+            if ( in[cursor + 1] == '\n' )
+               cursor += 2;
+            else
+               cursor++;
+         }
+         else
+            cursor++;
+      }
+   }
+   
+   return out;
+}
+
+
 String
 strutil_enforceNativeCRLF(String const &in)



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to