]> git.sur5r.net Git - i3/i3/blobdiff - src/commands.c
Merge pull request #1515 from Airblader/feature-commands-error-messages
[i3/i3] / src / commands.c
index 13e0fa7e88df6104d17a311205249b44e49bf794..0a64b2b82b7f0310d8327dd4cc83d5f4f5383828 100644 (file)
@@ -902,11 +902,15 @@ void cmd_nop(I3_CMD, char *comment) {
 void cmd_append_layout(I3_CMD, char *path) {
     LOG("Appending layout \"%s\"\n", path);
 
+    /* Make sure we allow paths like '~/.i3/layout.json' */
+    path = resolve_tilde(path);
+
     json_content_t content = json_determine_content(path);
     LOG("JSON content = %d\n", content);
     if (content == JSON_CONTENT_UNKNOWN) {
         ELOG("Could not determine the contents of \"%s\", not loading.\n", path);
         ysuccess(false);
+        free(path);
         return;
     }
 
@@ -948,6 +952,7 @@ void cmd_append_layout(I3_CMD, char *path) {
     if (content == JSON_CONTENT_WORKSPACE)
         ipc_send_workspace_event("restored", parent, NULL);
 
+    free(path);
     cmd_output->needs_tree_render = true;
 }