[Freeciv-Dev] Re: Weird statement
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
You need more context to unscramble this one. I looked at the
source. And while I am confused, here are some options.
1) It is not a flip of variables, i.e. str=cptr_s to mark the
spot, as str isn't used after.
2) It really looks like it could have been an old version of the
previous for, or some sanity repeat of the previous that takes
out more than just whitespace.
3) It could also be a cut and paste error that reinitializes the
counter accidently - this is most likely.
4) It might be swapped with the PREFIX condition, in that once
you eliminate leading trash and the prefix, you are ready to
begin command parsing.
5) But I don't know if PREFIXes can have trailing white space.
Cheers,
RossW
=====
At 09:34 AM 01/08/26 +0200, Raimar Falke wrote:
>
>Searching for a solution to the "allow comments in every server
>command" problem I found this one: server/stdinhand.c
>
> /* commands may be prefixed with SERVER_COMMAND_PREFIX,
> even when given on the server command line - rp */
>
> if (*cptr_s == SERVER_COMMAND_PREFIX) cptr_s++;
>
> for(cptr_s=str; *cptr_s && !isalnum(*cptr_s); cptr_s++);
>
>The if has no effect since the first statement of the for loop
>"cptr_s=str" overwrites it. Correct?!
>
> Raimar
>--
> email: rf13@xxxxxxxxxxxxxxxxx
> "Are you saying that you actually used the Classpath Java AWT classes in
> addition to the GTK peers and got them to display something?
> Wow. That's way better than I did and I wrote the code!"
> -- Aaron M. Renn in the classpath mailing list
|
|