From 404af77c9b83e38142c7d1bf2b0a3e3f01e93b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Strohh=C3=A4cker?= Date: Sat, 15 Aug 2009 09:32:20 +0000 Subject: [PATCH] allow working-directory specifying for copy parameters (ripsaw; fixes Wrath of Earth regression) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3457 --- src/shell/shell_cmds.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/shell/shell_cmds.cpp b/src/shell/shell_cmds.cpp index 11464510..8566b0c6 100644 --- a/src/shell/shell_cmds.cpp +++ b/src/shell/shell_cmds.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: shell_cmds.cpp,v 1.91 2009-07-25 16:25:43 c2woody Exp $ */ +/* $Id: shell_cmds.cpp,v 1.92 2009-08-15 09:32:20 c2woody Exp $ */ #include "dosbox.h" #include "shell.h" @@ -576,10 +576,17 @@ void DOS_Shell::CMD_COPY(char * args) { char* plus = strchr(source_p,'+'); if (plus) *plus++ = 0; safe_strncpy(source_x,source_p,CROSS_LEN); - if (DOS_FindFirst(source_p,0xffff & ~DOS_ATTR_VOLUME)) { - dta.GetResult(name,size,date,time,attr); - if (attr & DOS_ATTR_DIRECTORY && !strstr(source_p,"*.*")) - strcat(source_x,"\\*.*"); + bool has_drive_spec = false; + size_t source_x_len = strlen(source_x); + if (source_x_len>0) { + if (source_x[source_x_len-1]==':') has_drive_spec = true; + } + if (!has_drive_spec) { + if (DOS_FindFirst(source_p,0xffff & ~DOS_ATTR_VOLUME)) { + dta.GetResult(name,size,date,time,attr); + if (attr & DOS_ATTR_DIRECTORY && !strstr(source_p,"*.*")) + strcat(source_x,"\\*.*"); + } } sources.push_back(copysource(source_x,(plus)?true:false)); source_p = plus;