application/davcontroller.c

changeset 24
12ad3393c151
parent 22
d7942163a2a3
child 25
915131bc3233
--- 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);

mercurial