X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flocale%2Flocalectl.c;h=383a17dee12d93390317706b7edc366fc85f652b;hp=84feb25d521d0a6d612436b34a12dfc5f30f1e3b;hb=6b2b6f30e38d67b032d6bdc6b47ae05e143e96c5;hpb=2f7a4867babd3fd382e5495f21724358f30fa67d diff --git a/src/locale/localectl.c b/src/locale/localectl.c index 84feb25d5..383a17dee 100644 --- a/src/locale/localectl.c +++ b/src/locale/localectl.c @@ -19,6 +19,7 @@ along with systemd; If not, see . ***/ +#include #include #include #include @@ -483,7 +484,8 @@ static int nftw_cb( } static int list_vconsole_keymaps(DBusConnection *bus, char **args, unsigned n) { - char **l, **i; + char _cleanup_strv_free_ **l = NULL; + char **i; keymaps = set_new(string_hash_func, string_compare_func); if (!keymaps) @@ -513,7 +515,6 @@ static int list_vconsole_keymaps(DBusConnection *bus, char **args, unsigned n) { STRV_FOREACH(i, l) puts(*i); - strv_free(l); return 0; } @@ -536,7 +537,7 @@ static int set_x11_keymap(DBusConnection *bus, char **args, unsigned n) { layout = args[1]; model = n > 2 ? args[2] : ""; variant = n > 3 ? args[3] : ""; - options = n > 3 ? args[4] : ""; + options = n > 4 ? args[4] : ""; b = arg_convert; return bus_method_call_with_reply( @@ -740,6 +741,7 @@ int main(int argc, char *argv[]) { dbus_error_init(&error); + setlocale(LC_ALL, ""); log_parse_environment(); log_open();