@flag/add of a flag that is a unique prefix of another flag wouldn't work
authorAri Johnson <ari@cobramush.org>
Tue, 20 Feb 2007 15:34:02 +0000 (15:34 +0000)
committerAri Johnson <ari@cobramush.org>
Tue, 20 Feb 2007 15:34:02 +0000 (15:34 +0000)
src/flags.c

index 5a5dfe69db997780d6a0454c508bb72573709459..a8be8971b8b486257030faed7a67f423e9475896 100644 (file)
@@ -1917,8 +1917,10 @@ add_flag(const char *name, const char letter, int type,
   FLAGSPACE *n;
   n = hashfind("FLAG", &htab_flagspaces);
   /* Don't double-add */
-  if ((f = match_flag_ns(n, strupper(name))))
-    return f;
+  if ((f = match_flag_ns(n, strupper(name)))) {
+    if (strcasecmp(f->name, name) == 0)
+      return f;
+  }
   f = new_flag();
   f->name = mush_strdup(strupper(name), "flag name");
   f->letter = letter;