On 02/15/12 at 02:54pm, John Shaver wrote:
> On Wed, Feb 15, 2012 at 2:51 PM, John Shaver <[email protected]> wrote:
> > Here is a link where you can download the source code.
> 
> Forgot the link:
> 
> http://jshaver.net/test/source.zip

Looks like tests.txt uses DOS line endings. When you run on Windows
"\r\n" is being returned to you as "\n". On Linux, it isn't. Here's a
patch to fix it (inline so it doesn't get scrubbed):

diff -u source.orig/calc.cpp source/calc.cpp
--- source.orig/calc.cpp        2012-02-14 21:57:33.000000000 -0700
+++ source/calc.cpp     2012-02-15 15:28:03.392211261 -0700
@@ -69,6 +69,10 @@
                                assert(parenthesis);
                                f.ignore(1, EOF);
                        }
+                       else if(next == '\r')
+                       {
+                               f.ignore(1, EOF);
+                       }
                        else if(next == '\n')
                        {
                                while(ops.size())

-- 
Byron Clark

Attachment: pgpyC0g7YzUoT.pgp
Description: PGP signature

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to