Don't append an extension like ".c32" if the command already has one!
This bug lead to "config.c32" being executed as "config.c32.c32" with
the below config snippet,
LABEL config
COM32 config.c32 /configs/isolinux.cfg
Reported-by: Ady <ady-sf@hotmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
memcpy(k, kernel, len);
/* Append the extension */
- memcpy(k + len, ext, elen);
+ if (strncmp(p - elen, ext, elen)) {
+ memcpy(k + len, ext, elen);
+ len += elen;
+ }
/* Copy the rest of the command line */
- strcpy(k + len + elen, p);
+ strcpy(k + len, p);
- k[len + elen + strlen(p)] = '\0';
+ k[len + strlen(p)] = '\0';
return k;
}