ldlinux: Fixup lwip merge botch
authorMatt Fleming <matt.fleming@intel.com>
Fri, 15 Mar 2013 16:32:52 +0000 (16:32 +0000)
committerMatt Fleming <matt.fleming@intel.com>
Fri, 15 Mar 2013 17:16:29 +0000 (17:16 +0000)
The lwip merge changed the code for copying cmdline arguments from,

    strcpy(q, p);

to this,

    do {
*q++ = ch = *p++;
    } while (ch);

which means 'p' no longer points at 'args'. Use 'args' explicitly for
the case where we need to apply a filename extension, otherwise users
end up seeing errors like,

    Failed to load COM32 file .c32

Reported-by: Mattias Schlenker <ms@mattiasschlenker.de>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
com32/elflink/ldlinux/execute.c

index 49a0de5..bf0bd8c 100644 (file)
@@ -101,6 +101,7 @@ __export void execute(const char *cmdline, uint32_t type, bool sysappend)
                                 * filename extension if COM32 and
                                 * retry.
                                 */
+                               p = args;
                                if (t->type == IMAGE_TYPE_COM32) {
                                        p = apply_extension(p, ".c32");
                                        if (!p)