Re: [BUG]Help retrieval bug

From: Daniel A. Koepke (dkoepke@circlemud.org)
Date: 01/06/03


On Tue, 7 Jan 2003, Thomas Arp wrote:

> After having a bit of a problem in my running port, I fired up a
> sparkling new stock 3.1 and tested to see if the problem occured there
> too. As you may figure, since I'm sending this, it does.

The one_word() routine ignores fill words (such as "at").  It probably
shouldn't.  Its only use in stock CircleMUD 3.1 is in help file loading,
where we want fill words to be recognized.  Unless someone has an
objection, I'll commit the following patch (diff -ub to keep it short and
sweet) to CVS.  The alternative is to create an any_one_word() function
which does the same tokenizing as one_word(), but without ignoring fill
words.  I'm not particularly fond of the alternative: it leaves dead code
in stock CircleMUD.


--8< Begin Snip >8--------------------------------------------------------

--- ../../circle-3.1/src/interpreter.c 2002-10-03 21:24:47.000000000 -0700
+++ interpreter.c 2003-01-06 14:03:31.000000000 -0800
@@ -966,18 +966,15 @@


 /*
- * one_word is like one_argument, except that words in quotes ("") are
+ * one_word is like any_one_arg, except that words in quotes ("") are
  * considered one word.
+ *
+ * No longer ignores fill words.  -dak, 6 Jan 2003.
  */
 char *one_word(char *argument, char *first_arg)
 {
-  char *begin = first_arg;
-
-  do {
     skip_spaces(&argument);

-    first_arg = begin;
-
     if (*argument == '\"') {
       argument++;
       while (*argument && *argument != '\"') {
@@ -993,8 +990,6 @@
     }

     *first_arg = '\0';
-  } while (fill_word(begin));
-
   return (argument);
 }

--8< End Snip >8----------------------------------------------------------

-dak

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/26/03 PDT