From: H. Peter Anvin Date: Thu, 25 Jan 2007 05:49:53 +0000 (-0800) Subject: DOS FAT installer: Fix name mangling for -d option X-Git-Tag: syslinux-3.35-pre3~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=882835c1dd619237dcc41cc7aaa2e7972003a67a;p=platform%2Fupstream%2Fsyslinux.git DOS FAT installer: Fix name mangling for -d option --- diff --git a/dos/syslinux.c b/dos/syslinux.c index 7774212..31fb905 100644 --- a/dos/syslinux.c +++ b/dos/syslinux.c @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- * * - * Copyright 1998-2004 H. Peter Anvin - All Rights Reserved + * Copyright 1998-2007 H. Peter Anvin - All Rights Reserved * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -603,11 +603,18 @@ int main(int argc, char *argv[]) new_ldlinux_name[2] = '\\'; for (sd = subdir; *sd; sd++) { - if (*sd == '/' || *sd == '\\') { + char c = *sd; + + if (c == '/' || c == '\\') { if (slash) continue; - *cp++ = '\\'; + c = '\\'; + slash = 1; + } else { + slash = 0; } + + *cp++ = c; } /* Skip if subdirectory == root */