[PATCH] xcopy: Avoid an empty if-block.

Michael Stefaniuc mstefani at winehq.org
Tue Oct 20 18:02:39 CDT 2020


Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
Didn't want to hide this in the L"string" change even though the if
change itself is a no-op (same object files when compiled with -g0).


 programs/xcopy/xcopy.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/programs/xcopy/xcopy.c b/programs/xcopy/xcopy.c
index a8614f979ac..bb255f85446 100644
--- a/programs/xcopy/xcopy.c
+++ b/programs/xcopy/xcopy.c
@@ -533,16 +533,11 @@ static int XCOPY_DoCopy(WCHAR *srcstem, WCHAR *srcspec,
 
             /* Output a status message */
             if (!skipFile) {
-                if (flags & OPT_QUIET) {
-                    /* Skip message */
-                } else if (flags & OPT_FULL) {
-                    const WCHAR infostr[]   = {'%', '1', ' ', '-', '>', ' ',
-                                               '%', '2', '\n', 0};
-
-                    XCOPY_wprintf(infostr, copyFrom, copyTo);
-                } else {
-                    const WCHAR infostr[] = {'%', '1', '\n', 0};
-                    XCOPY_wprintf(infostr, copyFrom);
+                if (!(flags & OPT_QUIET)) {
+                    if (flags & OPT_FULL)
+                        XCOPY_wprintf(L"%1 -> %2\n", copyFrom, copyTo);
+                    else
+                        XCOPY_wprintf(L"%1\n", copyFrom);
                 }
 
                 /* If allowing overwriting of read only files, remove any
-- 
2.26.2




More information about the wine-devel mailing list