From: <mie...@us...> - 2012-02-12 20:07:30
|
Revision: 7521 http://oorexx.svn.sourceforge.net/oorexx/?rev=7521&view=rev Author: miesfeld Date: 2012-02-12 20:07:24 +0000 (Sun, 12 Feb 2012) Log Message: ----------- 3279812 NOBUFFER option ignored for WRITE Modified Paths: -------------- main/trunk/interpreter/streamLibrary/StreamNative.cpp Modified: main/trunk/interpreter/streamLibrary/StreamNative.cpp =================================================================== --- main/trunk/interpreter/streamLibrary/StreamNative.cpp 2012-02-12 15:11:49 UTC (rev 7520) +++ main/trunk/interpreter/streamLibrary/StreamNative.cpp 2012-02-12 20:07:24 UTC (rev 7521) @@ -469,6 +469,30 @@ } /** + * Helper function to determine if opts contains the no buffer option. + * + * @param opts String to search in for NOBUFFER. + * + * @return True if nobuffer, caseless, is in opts, otherwise false. + */ +bool hasNoBufferOption(const char *opts) +{ + char *tmp = (char *)malloc(strlen(opts) + 1); + if (tmp == NULL) + { + return false; + } + + strcpy(tmp, opts); + Utilities::strupper(tmp); + + bool result = strstr(tmp, "NOBUFFER") != NULL ? true : false; + free(tmp); + + return result; +} + +/** * Open a standard stream, using the provided options string. * * @param options Open parameters, in character string form. @@ -504,7 +528,7 @@ } // check to see if buffering is allowed. - if (options != NULL && !Utilities::strCaselessCompare(options, "NOBUFFER")) + if (options != NULL && hasNoBufferOption(options)) { nobuffer = 1; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |