=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: cmd: Simplify boolean expressions (PVS-Studio).

Alexandre Julliard julliard at wine.codeweavers.com
Wed Oct 14 11:12:50 CDT 2015


Module: wine
Branch: master
Commit: 23e7b5a6b0fcb787d4b322f508054a8fdbcc9cd0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=23e7b5a6b0fcb787d4b322f508054a8fdbcc9cd0

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Wed Oct 14 01:58:38 2015 +0200

cmd: Simplify boolean expressions (PVS-Studio).

Signed-off-by: Frédéric Delanoy <frederic.delanoy at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/cmd/builtins.c | 2 +-
 programs/cmd/wcmdmain.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index 5661c69..e9b9ddd 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -1005,7 +1005,7 @@ void WCMD_copy(WCHAR * args) {
       if (!srcisdevice) FindClose (hff);
     } else {
       /* Error if the first file was not found */
-      if (!anyconcats || (anyconcats && !writtenoneconcat)) {
+      if (!anyconcats || !writtenoneconcat) {
         WCMD_print_error ();
         errorlevel = 1;
       }
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 7666329..ba7d9ca 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -879,7 +879,7 @@ static void handleExpansion(WCHAR *cmd, BOOL atExecute, BOOL delayed) {
       if (startchar == '%' && forvaridx != -1 && forloopcontext.variable[forvaridx]) {
         /* Replace the 2 characters, % and for variable character */
         WCMD_strsubstW(p, p + 2, forloopcontext.variable[forvaridx], -1);
-      } else if (!atExecute || (atExecute && startchar == '!')) {
+      } else if (!atExecute || startchar == '!') {
         p = WCMD_expand_envvar(p, startchar);
 
       /* In a FOR loop, see if this is the variable to replace */




More information about the wine-cvs mailing list