File Disallow-empty-output-directory.patch of Package zstd.28321

---
 programs/zstdcli.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--- a/programs/zstdcli.c
+++ b/programs/zstdcli.c
@@ -757,7 +757,14 @@ int main(int argCount, const char* argv[
                     if (longCommandWArg(&argument, "--stream-size=")) { streamSrcSize = readU32FromChar(&argument); continue; }
                     if (longCommandWArg(&argument, "--target-compressed-block-size=")) { targetCBlockSize = readU32FromChar(&argument); continue; }
                     if (longCommandWArg(&argument, "--size-hint=")) { srcSizeHint = readU32FromChar(&argument); continue; }
-                    if (longCommandWArg(&argument, "--output-dir-flat=")) { outDirName = argument; continue; }
+                    if (longCommandWArg(&argument, "--output-dir-flat=")) {
+                        outDirName = argument;
+                        if (strlen(outDirName) == 0) {
+                            DISPLAY("error: output dir cannot be empty string (did you mean to pass '.' instead?)\n");
+                            CLEAN_RETURN(1);
+                        }
+                        continue;
+                    }
                     if (longCommandWArg(&argument, "--long")) {
                         unsigned ldmWindowLog = 0;
                         ldmFlag = 1;
openSUSE Build Service is sponsored by