diff src/DLD-FUNCTIONS/lookup.cc @ 11560:05b5bcdb09c8

validate opts in lookup
author Jaroslav Hajek <highegg@gmail.com>
date Mon, 17 Jan 2011 22:19:29 +0100
parents 01f703952eff
children 57632dea2446
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/lookup.cc	Mon Jan 17 14:33:38 2011 -0500
+++ b/src/DLD-FUNCTIONS/lookup.cc	Mon Jan 17 22:19:29 2011 +0100
@@ -264,6 +264,12 @@
       right_inf = contains_char (opt, 'r');
       match_idx = contains_char (opt, 'm');
       match_bool = contains_char (opt, 'b');
+      if (opt.find_first_not_of ("lrmb") != std::string::npos)
+        {
+          error ("lookup: unrecognized option: %c",
+                 opt[opt.find_first_not_of ("lrmb")]);
+          return retval;
+        }
     }
 
   if ((match_idx || match_bool) && (left_inf || right_inf))