]> git.ipfire.org Git - collecty.git/commitdiff
client: Use the user's locale if none specified
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 Oct 2025 19:20:34 +0000 (19:20 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 Oct 2025 19:20:34 +0000 (19:20 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/client/main.c

index 04a60bebaebb0ecc49e1c92e70e34beb85f45e00..1bedad7bf101fe770e7ddf6066cfec59daf782e9 100644 (file)
@@ -19,6 +19,7 @@
 #############################################################################*/
 
 #include <argp.h>
+#include <locale.h>
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
@@ -157,6 +158,10 @@ static error_t parse(int key, char* arg, struct argp_state* state) {
                        if (state->arg_num < 1)
                                argp_usage(state);
 
+                       // Use the current locale if nothing has been set
+                       if (!ctx->locale)
+                               ctx->locale = setlocale(LC_ALL, NULL);
+
                        break;
 
                default: