# HG changeset patch
# User Olaf Wintermann <olaf.wintermann@gmail.com>
# Date 1707384679 -3600
# Node ID 12ad3393c1513cbd705c493c3fadfaa0c3f475cb
# Parent  cdcb20412dd4ab22d15e5724812682e8068a14f7
don't show number of uploading files when there is only 1 file

diff -r cdcb20412dd4 -r 12ad3393c151 application/davcontroller.c
--- a/application/davcontroller.c	Thu Feb 08 10:29:29 2024 +0100
+++ b/application/davcontroller.c	Thu Feb 08 10:31:19 2024 +0100
@@ -290,12 +290,20 @@
         *sz_uploaded_end = 0;
     }
 
-    cxmutstr label1 = cx_asprintf(
-        "%s/%s   %zu/%zu files",
-        sz_uploaded,
-        sz_total,
-        upload->uploaded_files+upload->uploaded_directories,
-        upload->total_files+upload->total_directories);
+    cxmutstr label1;
+    if (upload->total_files + upload->total_directories > 1) {
+        label1 = cx_asprintf(
+            "%s/%s   %zu/%zu files",
+            sz_uploaded,
+            sz_total,
+            upload->uploaded_files+upload->uploaded_directories,
+            upload->total_files+upload->total_directories);
+    } else {
+        label1 = cx_asprintf(
+            "%s/%s",
+            sz_uploaded,
+            sz_total);
+    }
     ui_set(upload->label_top_left, label1.ptr);
 
     free(sz_total);