DOS FAT installer: Fix name mangling for -d option
authorH. Peter Anvin <hpa@zytor.com>
Thu, 25 Jan 2007 05:49:53 +0000 (21:49 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Thu, 25 Jan 2007 05:49:53 +0000 (21:49 -0800)
dos/syslinux.c

index 7774212..31fb905 100644 (file)
@@ -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 */