diff options
-rw-r--r-- | xombrero.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/xombrero.c b/xombrero.c index 87c025c..ce5082c 100644 --- a/xombrero.c +++ b/xombrero.c @@ -1311,23 +1311,23 @@ open_tabs(struct tab *t, struct karg *a) goto done; for (;;) { - if ((uri = fparseln(f, NULL, NULL, "\0\0\0", 0)) == NULL) + if ((uri = fparseln(f, NULL, NULL, "\0\0\0", 0)) == NULL) { if (feof(f) || ferror(f)) break; + } else { + /* retrieve session name */ + if (g_str_has_prefix(uri, XT_SAVE_SESSION_ID)) { + strlcpy(named_session, + &uri[strlen(XT_SAVE_SESSION_ID)], + sizeof named_session); + continue; + } - /* retrieve session name */ - if (uri && g_str_has_prefix(uri, XT_SAVE_SESSION_ID)) { - strlcpy(named_session, - &uri[strlen(XT_SAVE_SESSION_ID)], - sizeof named_session); - continue; - } - - if (uri && strlen(uri)) - create_new_tab(uri, NULL, 1, -1); + if (strlen(uri)) + create_new_tab(uri, NULL, 1, -1); - free(uri); - uri = NULL; + free(uri); + } } /* close open tabs */ |