about summary refs log tree commit diff stats
path: root/src/command/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/command/commands.c')
-rw-r--r--src/command/commands.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index bebf9d3c..0fc8574b 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -2287,6 +2287,10 @@ cmd_log(gchar **args, struct cmd_help_t help)
     int intval;
 
     if (strcmp(subcmd, "maxsize") == 0) {
+        if (value == NULL) {
+            cons_show("Usage: %s", help.usage);
+            return TRUE;
+        }
         if (_strtoi(value, &intval, PREFS_MIN_LOG_SIZE, INT_MAX) == 0) {
             prefs_set_max_log_size(intval);
             cons_show("Log maxinum size set to %d bytes", intval);
@@ -2298,22 +2302,24 @@ cmd_log(gchar **args, struct cmd_help_t help)
         if (value == NULL) {
             cons_show("Usage: %s", help.usage);
             return TRUE;
-        } else {
-            return _cmd_set_boolean_preference(value, help,
-                "Log rotate", PREF_LOG_ROTATE);
         }
+        return _cmd_set_boolean_preference(value, help, "Log rotate", PREF_LOG_ROTATE);
     }
 
     if (strcmp(subcmd, "shared") == 0) {
         if (value == NULL) {
             cons_show("Usage: %s", help.usage);
             return TRUE;
-        } else {
-            gboolean result = _cmd_set_boolean_preference(value, help,
-                "Shared log", PREF_LOG_SHARED);
-            log_reinit();
-            return result;
         }
+        gboolean result = _cmd_set_boolean_preference(value, help, "Shared log", PREF_LOG_SHARED);
+        log_reinit();
+        return result;
+    }
+
+    if (strcmp(subcmd, "where") == 0) {
+        char *logfile = get_log_file_location();
+        cons_show("Log file: %s", logfile);
+        return TRUE;
     }
 
     cons_show("Usage: %s", help.usage);