Fixed bug in COPY command
authorEric Kohl <eric.kohl@reactos.org>
Sat, 8 Apr 2000 14:50:47 +0000 (14:50 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 8 Apr 2000 14:50:47 +0000 (14:50 +0000)
svn path=/trunk/; revision=1112

rosapps/cmd/bugs.txt
rosapps/cmd/cmd.c
rosapps/cmd/config.h
rosapps/cmd/copy.c
rosapps/cmd/history.txt
rosapps/cmd/ver.c

index 2cfa275..da1a2d6 100644 (file)
@@ -1,6 +1,6 @@
-         ****  Please report bugs to ekohl@abo.rhein-zeitung.de!  ****
+         ****  Please report bugs to ekohl@rz-online.de!  ****
 
-Known bugs in CMD version 0.0.4
+Known bugs in CMD version 0.1
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 o  let set work with or without the '=' sign.  People like it that way.
@@ -12,4 +12,4 @@ o  command.com ignores control-c and control-break, which makes it difficult
 o  "alias v = dir" doesn't work because of the spaces.
 
 
-         ****  Please report bugs to ekohl@abo.rhein-zeitung.de!  ****
+         ****  Please report bugs to ekohl@rz-online.de!  ****
index 56eb568..94b0edb 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: cmd.c,v 1.19 2000/02/18 00:53:11 ekohl Exp $
+/* $Id: cmd.c,v 1.20 2000/04/08 14:50:47 ekohl Exp $
  *
  *  CMD.C - command-line interface.
  *
 #include "batch.h"
 
 
-#define CMDLINE_LENGTH  1024
+#define CMDLINE_LENGTH  2048    //1024
 
 
 BOOL bExit = FALSE;       /* indicates EXIT was typed */
index db75fd8..65f8dac 100644 (file)
@@ -22,7 +22,7 @@
 
 
 /* Define to enable debugging code */
-/* #define _DEBUG */
+//#define _DEBUG
 
 
 /* Define to enable the alias command, and aliases.*/
index 51f6cb6..3e6ea7a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: copy.c,v 1.6 1999/12/24 17:20:54 ekohl Exp $
+/* $Id: copy.c,v 1.7 2000/04/08 14:50:47 ekohl Exp $
  *
  *  COPY.C -- copy internal command.
  *
@@ -484,9 +484,10 @@ int copy (LPTSTR source, LPTSTR dest, int append, LPDWORD lpdwFlags)
 }
 
 
-int setup_copy (LPFILES sources, char **p, BOOL bMultiple,
-               char *drive_d, char *dir_d, char *file_d,
-               char *ext_d, int *append, LPDWORD lpdwFlags)
+static INT
+SetupCopy (LPFILES sources, char **p, BOOL bMultiple,
+           char *drive_d, char *dir_d, char *file_d,
+           char *ext_d, int *append, LPDWORD lpdwFlags)
 {
        WIN32_FIND_DATA find;
 
@@ -504,6 +505,10 @@ int setup_copy (LPFILES sources, char **p, BOOL bMultiple,
        BOOL bDone;
        HANDLE hFind;
 
+#ifdef _DEBUG
+       DebugPrintf (_T("SetupCopy\n"));
+#endif
+
        real_source = (LPTSTR)malloc (MAX_PATH);
        real_dest = (LPTSTR)malloc (MAX_PATH);
 
@@ -524,7 +529,6 @@ int setup_copy (LPFILES sources, char **p, BOOL bMultiple,
                if (hFind == INVALID_HANDLE_VALUE)
                {
                        error_file_not_found();
-                       DeleteFileList (sources);
                        freep(p);
                        free(real_source);
                        free(real_dest);
@@ -703,7 +707,7 @@ INT cmd_copy (LPTSTR first, LPTSTR rest)
 
        if (bDestFound && !bWildcards)
        {
-               copied = setup_copy (sources, p, bMultiple, drive_d, dir_d, file_d, ext_d, &append, &dwFlags);
+               copied = SetupCopy (sources, p, bMultiple, drive_d, dir_d, file_d, ext_d, &append, &dwFlags);
        }
        else if (bDestFound && bWildcards)
        {
@@ -722,7 +726,7 @@ INT cmd_copy (LPTSTR first, LPTSTR rest)
                        file_d[0] = _T('\0');
                        ext_d[0] = _T('\0');
                }
-               copied = setup_copy (sources, p, FALSE, "", "", file_d, ext_d, &append, &dwFlags);
+               copied = SetupCopy (sources, p, FALSE, "", "", file_d, ext_d, &append, &dwFlags);
        }
        else
        {
@@ -737,7 +741,7 @@ INT cmd_copy (LPTSTR first, LPTSTR rest)
 
                ConOutPuts (sources->szFile);
                append = 1;
-               copied = setup_copy (sources->next, p, bMultiple, drive_d, dir_d, file_d, ext_d, &append, &dwFlags) + 1;
+               copied = SetupCopy (sources->next, p, bMultiple, drive_d, dir_d, file_d, ext_d, &append, &dwFlags) + 1;
        }
 
        DeleteFileList (sources);
index 14a3ca9..c1dfa61 100644 (file)
@@ -357,3 +357,7 @@ o Added and fixed missing help texts.
 o Fixed bugs in MD and RD that crashed cmd when no directory was specified.
 o Improved history support.
 o Improved COLOR command.
+
+09-Apr-2000 ReactOS CMD version 0.1 (EricKohl <ekohl@rz-online.de>
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+o Fixed bug in COPY command. CMD crashed if source file didn't exist.
index 04cdc9c..4c50117 100644 (file)
@@ -35,8 +35,8 @@
 VOID ShortVersion (VOID)
 {
        ConOutPuts (_T("\n"
-                                  SHELLINFO "\n"
-                                  SHELLVER "\n"));
+                      SHELLINFO "\n"
+                      SHELLVER "\n"));
 }
 
 
@@ -64,20 +64,20 @@ INT cmd_ver (LPTSTR cmd, LPTSTR param)
        }
 
        ConOutPuts (_T("\n"
-                                  SHELLINFO "\n"
-                                  SHELLVER "\n"
-                                  "\n"
-                                  "Copyright (C) 1994-1998 Tim Norman and others."));
-       ConOutPuts (_T("Copyright (C) 1998,1999 Eric Kohl and others."));
+                      SHELLINFO "\n"
+                      SHELLVER "\n"
+                      "\n"
+                      "Copyright (C) 1994-1998 Tim Norman and others."));
+       ConOutPuts (_T("Copyright (C) 1998-2000 Eric Kohl and others."));
 
        /* Basic copyright notice */
        if (param[0] == _T('\0'))
        {
                ConOutPuts (_T("\n"SHELLINFO
-                                          " comes with ABSOLUTELY NO WARRANTY; for details\n"
-                                          "type: `ver /w'. This is free software, and you are welcome to redistribute\n"
-                                          "it under certain conditions; type `ver /r' for details. Type `ver /c' for a\n"
-                                          "listing of credits."));
+                              " comes with ABSOLUTELY NO WARRANTY; for details\n"
+                              "type: `ver /w'. This is free software, and you are welcome to redistribute\n"
+                              "it under certain conditions; type `ver /r' for details. Type `ver /c' for a\n"
+                              "listing of credits."));
        }
        else
        {
@@ -102,33 +102,33 @@ INT cmd_ver (LPTSTR cmd, LPTSTR param)
                        {
                                /* Warranty notice */
                                ConOutPuts (_T("\n This program is distributed in the hope that it will be useful,\n"
-                                                          " but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-                                                          " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
-                                                          " GNU General Public License for more details."));
+                                              " but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+                                              " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
+                                              " GNU General Public License for more details."));
                        }
                        else if (_totupper (param[i]) == _T('R'))
                        {
                                /* Redistribution notice */
                                ConOutPuts (_T("\n This program is free software; you can redistribute it and/or modify\n"
-                                                          " it under the terms of the GNU General Public License as published by\n"
-                                                          " the Free Software Foundation; either version 2 of the License, or\n"
-                                                          " (at your option) any later version."));
+                                              " it under the terms of the GNU General Public License as published by\n"
+                                              " the Free Software Foundation; either version 2 of the License, or\n"
+                                              " (at your option) any later version."));
                        }
                        else if (_totupper (param[i]) == _T('C'))
                        {
                                /* Developer listing */
                                ConOutPuts (_T("\n"
-                                                          "FreeDOS version written by:\n"
-                                                          "    Tim Norman      Matt Rains\n"
-                                                          "    Evan Jeffrey    Steffen Kaiser\n"
-                                                          "    Svante Frey     Oliver Mueller\n"
-                                                          "    Aaron Kaufman   Marc Desrochers\n"
-                                                          "    Rob Lake        John P Price\n"
-                                                          "    Hans B Pufal\n"
-                                                          "\n"
-                                                          "ReactOS version written by:\n"
-                                                          "    Eric Kohl       Emanuele Aliberti\n"
-                                                          "    Paolo Pantaleo\n"));
+                                              "FreeDOS version written by:\n"
+                                              "    Tim Norman      Matt Rains\n"
+                                              "    Evan Jeffrey    Steffen Kaiser\n"
+                                              "    Svante Frey     Oliver Mueller\n"
+                                              "    Aaron Kaufman   Marc Desrochers\n"
+                                              "    Rob Lake        John P Price\n"
+                                              "    Hans B Pufal\n"
+                                              "\n"
+                                              "ReactOS version written by:\n"
+                                              "    Eric Kohl       Emanuele Aliberti\n"
+                                              "    Paolo Pantaleo\n"));
                        }
                        else
                        {
@@ -138,11 +138,9 @@ INT cmd_ver (LPTSTR cmd, LPTSTR param)
                }
        }
 
-       ConOutPuts (_T("\nSend bug reports to <ekohl@abo.rhein-zeitung.de>."
-/*
-                                  "\nUpdates are available at http://www.reactos.com"
-*/
-                          ));
+       ConOutPuts (_T("\n"
+                      "Send bug reports to <ekohl@rz-online.de>.\n"
+                      "Updates are available at: http://www.reactos.com"));
        return 0;
 }