diff -uraN mtools-4.0.11.orig/mainloop.c mtools-4.0.11/mainloop.c --- mtools-4.0.11.orig/mainloop.c 2009-10-26 14:26:15.000000000 +0300 +++ mtools-4.0.11/mainloop.c 2009-10-26 14:31:46.000000000 +0300 @@ -528,12 +528,7 @@ int target_lookup(MainParam_t *mp, const char *arg) { - if((mp->lookupflags & NO_UNIX) || (arg[0] -#ifdef OS_mingw32msvc -/* On Windows, support only the command-line image drive. */ - && arg[0] == ':' -#endif - && arg[1] == ':' )) + if((mp->lookupflags & NO_UNIX) || (arg[0] && arg[1] == ':' )) return dos_target_lookup(mp, arg); else return unix_target_lookup(mp, arg); diff -uraN mtools-4.0.11.orig/Makefile.in mtools-4.0.11/Makefile.in --- mtools-4.0.11.orig/Makefile.in 2009-10-26 14:26:15.000000000 +0300 +++ mtools-4.0.11/Makefile.in 2009-10-26 15:24:39.000000000 +0300 @@ -62,6 +62,7 @@ SHLIB = @SHLIB@ MACHDEPLIBS = @MACHDEPLIBS@ LN_S = @LN_S@ +EXE = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -173,7 +174,7 @@ $(LINKS): mtools - rm -f $@ && $(LN_S) mtools $@ + rm -f $@ && $(LN_S) mtools$(EXE) $@ mostlyclean: -rm -f *~ *.orig *.o a.out core 2>/dev/null @@ -261,7 +262,7 @@ install-links: $(DESTDIR)$(bindir)/mtools @for j in $(LINKS); do \ rm -f $(DESTDIR)$(bindir)/$$j ; \ - $(LN_S) mtools $(DESTDIR)$(bindir)/$$j ; \ + $(LN_S) mtools$(EXE) $(DESTDIR)$(bindir)/$$j ; \ echo $(DESTDIR)$(bindir)/$$j ; \ done @@ -273,7 +274,7 @@ echo $(DESTDIR)$(bindir)/$$j ; \ done rm -f $(DESTDIR)$(bindir)/lz - $(LN_S) uz $(DESTDIR)$(bindir)/lz + $(LN_S) $(DESTDIR)$(bindir)/uz $(DESTDIR)$(bindir)/lz install-man: @$(top_srcdir)/mkinstalldirs $(MAN1DIR) diff -uraN mtools-4.0.11.orig/missFuncs.c mtools-4.0.11/missFuncs.c --- mtools-4.0.11.orig/missFuncs.c 2009-10-26 14:26:15.000000000 +0300 +++ mtools-4.0.11/missFuncs.c 2009-10-26 14:34:21.000000000 +0300 @@ -420,11 +420,7 @@ #endif -#ifdef OS_mingw32msvc -static const char PATH_SEP = '\\'; -#else static const char PATH_SEP = '/'; -#endif /*#ifndef HAVE_BASENAME*/ const char *_basename(const char *filename) @@ -433,9 +429,15 @@ ptr = strrchr(filename, PATH_SEP); if(ptr) - return ptr+1; - else - return filename; + filename = ptr + 1; + +#ifdef OS_mingw32msvc + ptr = strrchr(filename, '\\'); + if(ptr) + filename = ptr + 1; +#endif + + return filename; } /*#endif*/