Issue 59: cpp.Sys.args not returning correct information
Status:  Fixed
Owner: ----
Closed:  Jan 2011
Reported by beatofth...@gmail.com, Aug 19, 2010
I'm using cpp.Sys.args() in my code to read the name of a file, in order for my code to read/decode the file.
Please see the attached file for a short sample piece of code.

In my sample code, I print the input that it thinks that I have entered, please see the following run cases:

===
peter@sony-laptop:~/Dev/haxe/testdir/filereadhaxecpp$ ./FileReadFails ../filereadhaxecpp/luckynight.wv 
FileReadFails.hx:12: File to read is ../filereadhaxecpp/luckynight.wv
FileReadFails.hx:16: End of main
peter@sony-laptop:~/Dev/haxe/testdir/filereadhaxecpp$ ./FileReadFails ./luckynight.wv 
FileReadFails.hx:12: File to read is //luckynight.wv
Error : [file_open, 
peter@sony-laptop:~/Dev/haxe/testdir/filereadhaxecpp$ ./FileReadFails luckynight.wv 
FileReadFails.hx:12: File to read is uuckynight.wv
Error : [file_open, 
===

So, in the above examples, we see in the first case that it worked correctly, however in the next two cases it did not work correctly. In case 2 and 3, it looks like it has decided that the first character is the same as the second character.

I'm running Ubuntu linux with haxe 2.06 and latest hxcpp (also tried SVN version).
FileReadFails.hx
357 bytes   View   Download
Aug 19, 2010
#1 beatofth...@gmail.com
Sorry, really should have said that in all cases it looks like it has decided that the first character should be the same as the second, however in the case of ".." that was correct!
Nov 25, 2010
#2 aleksey....@gmail.com
hxcpp/src/hx/StdLibsc.cpp
 - arg+=String(buf, 1);
 + arg+=String::fromCharCode(buf[0]);

Jan 17, 2011
Project Member #3 gameh...@gmail.com
Thanks aleksey, I have put this change in but have not had a chance to test it yet.  If someone can report it as fixed, then I can close it. Or I will test it later in the week.
Status: Started
Jan 19, 2011
Project Member #4 gameh...@gmail.com
I'm closing this one - I've tested in on linux.  There is still a report in the haxe issues, but I hope to close that one too.
Status: Fixed