Re: Restore

From: David Taylor (davidt@xfiles.nildram.co.uk)
Date: 04/04/99


On Sun, 4 Apr 1999, Del Minturn wrote:

> Albert Brauneis wrote:
> >
> > I wanted to add to restore the capability to type restore all and it would do
> > so. I added the code to do it but it seems no matter what I do it will not go
> > to that part of the code. This is what I had to check for it in
> > ACMD(do_restore)
> >
> > if (str_cmp("all",buf))
> >
> > That seems never to be true. Why is that?
> >
>
> I tried doing the same thing, but to my amazement I could only do
> restore all with the addition of the code, no matter what I typed. Its

Hmm.. Lets see: man 3 strcmp (same as str_cmp, but case sensitive).

       The  strcmp() function compares the two strings s1 and s2.
       It returns an integer less than, equal to, or greater than
       zero  if  s1  is  found, respectively, to be less than, to
       match, or be greater than s2.

So what you want is:

if (!str_cmp("all",buf))

[Personally, I prefer 'if (strcmp("all",buf) == 0)', because the above
 looks like if the strings aren't equal.  It just depends what you prefer]

> on my todo list to try and finish it. If anyone has a solution, I would
> be more than greatful to hear it also.

--
David Taylor
E-Mail: dtaylor@nildram.co.uk.spam
ICQ:    268004
[Remove .spam from e-mail to reply]


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST