[syslinux] [PATCH] chrreplace: Don't skip the first character
Gene Cumm
gene.cumm at gmail.com
Tue Sep 22 03:45:27 PDT 2015
Erwan, could you shed some light on this? Was the behavior
intentional? If not, I think it might prove more useful down the road
to commit this patch. Original code in commit ID 85d9a1a
--
-Gene
On Sat, May 16, 2015 at 3:30 AM, Josh Triplett via Syslinux
<syslinux at zytor.com> wrote:
> 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++;
> }
> }
>
More information about the Syslinux
mailing list