[syslinux] [PATCH] chrreplace: Don't skip the first character
Ady
ady-sf at hotmail.com
Mon Jun 15 10:57:24 PDT 2015
> Check if the first character matches the character to replace, rather
> than skipping it and starting with the second.
>
> Signed-off-by: Josh Triplett <josh at joshtriplett.org>
> ---
>
> I'm assuming, based on a look at the callers, that this is not
> intentional, and that it just happened that none of the callers happened
> to ever need to replace the first character.
>
> com32/lib/chrreplace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/com32/lib/chrreplace.c b/com32/lib/chrreplace.c
> index 65786f9..cfbf5d4 100644
> --- a/com32/lib/chrreplace.c
> +++ b/com32/lib/chrreplace.c
> @@ -4,8 +4,8 @@
> void chrreplace(char *source, char old, char new)
> {
> while (*source) {
> - source++;
> if (source[0] == old) source[0]=new;
> + source++;
> }
> }
>
> --
> 2.1.4
>
May I ask, where is this code having some effect?
Is there some way to trigger certain issue / effect / behavior with the
code as in version 6.03 that would be corrected / improved by this
patch?
Which would be the context / setup / config where some issue related to
this code could be triggered?
I am not criticizing the patch. I just would like to know, in the eyes
of a final user, what / where the effect of the code as found in v.6.03
could be seen, and the effect of this patch.
TIA,
Ady.
More information about the Syslinux
mailing list