changeset 14559:90c51d8797cc

also require that warning and error message identifiers do not contain whitespace * error.cc (maybe_extract_message_id): Don't recognize the first argument as a message identifier if it contains whitespace.
author John W. Eaton <jwe@octave.org>
date Fri, 13 Apr 2012 09:54:57 -0400
parents 0c9c85e702ca
children 638390eacec4
files src/error.cc
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/error.cc	Thu Apr 12 16:48:54 2012 -0400
+++ b/src/error.cc	Fri Apr 13 09:54:57 2012 -0400
@@ -986,9 +986,10 @@
         {
           // For compatibility with Matlab, an identifier must contain
           // ':', but not at the beginning or the end, and it must not
-          // contain '%' (even if it is not a valid conversion operator).
+          // contain '%' (even if it is not a valid conversion
+          // operator) or whitespace.
 
-          if (arg1.find ('%') == std::string::npos
+          if (arg1.find_first_of ("% \f\n\r\t\v") == std::string::npos
               && arg1.find (':') != std::string::npos
               && arg1[0] != ':'
               && arg1[arg1.length()-1] != ':')