diff NEWS @ 25698:ac386820f2b6

Return true when strncmp matches, but number of characters exceeds strlen (bug #54373) * NEWS: Announce change in behavior. * oct-string.cc (strncmp, strncmpi): Change templates to check length of strings against neff (N effective) which is the smaller of the actual string length or N itself. * strfns.cc: Add new BIST tests, marked as regressions, for this behavior. Change existing BIST tests to pass. * publish.m (is_publish_markup): New nested function replacing an anonymous function. This version does not index past the length of the string when checking if the N+1 character is a space.
author Rik <rik@octave.org>
date Wed, 25 Jul 2018 10:55:46 -0700
parents 45bd3edcbbcf
children c7095a755185
line wrap: on
line diff
--- a/NEWS	Fri Jul 27 18:15:17 2018 -0400
+++ b/NEWS	Wed Jul 25 10:55:46 2018 -0700
@@ -10,6 +10,14 @@
     with Matlab.  Change all uses of "ascending" and "descending" in
     existing code to the new options.
 
+ ** The strncmp and strncmpi functions now return true if the two input
+    strings match, even though the number of characters specified by N
+    exceeds the string length.  This behavior more closely matches
+    common sense and is Matlab compatible.  Example:
+
+      Octave 5.0 : strncmp ("abc", "abc", 100) => true
+      Previously : strncmp ("abc", "abc", 100) => false
+
  ** Figure graphic objects have a new property "Number" which is
     read-only and will return the handle (number) of the figure.
     However, if the property "IntegerHandle" has been set to "off" then