Mercurial > octave
comparison libinterp/corefcn/oct-stream.cc @ 30536:9e47c6f6b548 stable
Use octave_strncasecmp wrapper instead of strncasecmp.
* libinterp/corefcn/oct-stream.cc (textscan::lookahead): Use octave_strncasecmp
wrapper instead of calling POSIX function strncasecmp directly.
author | Gene Harvey <gharveymn@gmail.com> |
---|---|
date | Mon, 27 Sep 2021 10:38:27 -0500 |
parents | a61e1a0f6024 |
children | 91642eb6420e 796f54d4ddbf |
comparison
equal
deleted
inserted
replaced
30535:a8e988190128 | 30536:9e47c6f6b548 |
---|---|
40 #include <string> | 40 #include <string> |
41 | 41 |
42 #include "Array.h" | 42 #include "Array.h" |
43 #include "Cell.h" | 43 #include "Cell.h" |
44 #include "byte-swap.h" | 44 #include "byte-swap.h" |
45 #include "lo-cutils.h" | |
45 #include "lo-ieee.h" | 46 #include "lo-ieee.h" |
46 #include "lo-mappers.h" | 47 #include "lo-mappers.h" |
47 #include "lo-utils.h" | 48 #include "lo-utils.h" |
48 #include "oct-locbuf.h" | 49 #include "oct-locbuf.h" |
49 #include "octave-preserve-stream-state.h" | 50 #include "octave-preserve-stream-state.h" |
3894 is.seekg (pos); // reset to position before read | 3895 is.seekg (pos); // reset to position before read |
3895 // FIXME: pos may be corrupted by is.read | 3896 // FIXME: pos may be corrupted by is.read |
3896 | 3897 |
3897 int i; | 3898 int i; |
3898 int (*compare)(const char *, const char *, std::size_t); | 3899 int (*compare)(const char *, const char *, std::size_t); |
3899 compare = (case_sensitive ? strncmp : strncasecmp); | 3900 compare = (case_sensitive ? strncmp : octave_strncasecmp); |
3900 | 3901 |
3901 for (i = 0; i < targets.numel (); i++) | 3902 for (i = 0; i < targets.numel (); i++) |
3902 { | 3903 { |
3903 std::string s = targets (i).string_value (); | 3904 std::string s = targets (i).string_value (); |
3904 if (! (*compare) (s.c_str (), look, s.size ())) | 3905 if (! (*compare) (s.c_str (), look, s.size ())) |