Index: move.c =================================================================== --- move.c (revisión: 38889) +++ move.c (copia de trabajo) @@ -135,11 +135,9 @@ #endif return 0; } - nErrorLevel = 0; arg = splitspace(param, &argc); nFiles = argc; - /* read options */ for (i = 0; i < argc; i++) { @@ -151,28 +149,37 @@ { case _T('N'): dwFlags |= MOVE_NOTHING; + nFiles--; break; case _T('Y'): dwFlags |= MOVE_OVER_YES; + nFiles--; break; case _T('-'): dwFlags |= MOVE_OVER_NO; + nFiles--; break; } } - nFiles--; } } - + /*Treating Errors*/ if (nFiles < 2) { /* there must be at least two pathspecs */ - error_req_param_missing (); + error_req_param_missing(); return 1; } + if (nFiles > 2) + { + /* there are more than two pathspecs */ + error_too_many_parameters(param); + return 1; + } + /* check for wildcards in source and destination */ if (_tcschr (arg[argc - 1], _T('*')) != NULL || _tcschr (arg[argc - 1], _T('?')) != NULL) { @@ -185,7 +192,6 @@ dwMoveStatusFlags |= MOVE_SOURCE_HAS_WILD; } - /* get destination */ GetFullPathName (arg[argc - 1], MAX_PATH, szDestPath, NULL); TRACE ("Destination: %s\n", debugstr_aw(szDestPath)); @@ -198,9 +204,8 @@ and if it is then rip off last directory part so that there won't be any clashes with codes after this point */ GetFullPathName(arg[argc - 2], MAX_PATH, szSrcPath, &pszFile); if (_tcscmp(szSrcDirPath,szSrcPath) == 0) - szSrcDirPath[pszFile - szSrcPath] = _T('\0'); + szSrcDirPath[pszFile - szSrcPath] = _T('\0'); TRACE ("Source Folder: %s\n", debugstr_aw(szSrcDirPath)); - hFile = FindFirstFile (arg[argc - 2], &findBuffer); if (hFile == INVALID_HANDLE_VALUE) {