about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--xxxterm.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/xxxterm.c b/xxxterm.c
index 5d3ea81..2560a85 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -2622,6 +2622,19 @@ open_tabs(struct tab *t, struct karg *a)
 		goto done;
 
 	ti = TAILQ_LAST(&tabs, tab_list);
+	/* close open tabs */
+	if (a->i == XT_SES_CLOSETABS && ti != NULL) {
+		for (;;) {
+			tt = TAILQ_FIRST(&tabs);
+			if (tt != ti) {
+				delete_tab(tt);
+				continue;
+			}
+			delete_tab(tt);
+			break;
+		}
+		recalc_tabs();
+	}
 
 	for (;;) {
 		if ((uri = fparseln(f, NULL, NULL, "\0\0\0", 0)) == NULL)
@@ -2642,21 +2655,6 @@ open_tabs(struct tab *t, struct karg *a)
 		free(uri);
 		uri = NULL;
 	}
-
-	/* close open tabs */
-	if (a->i == XT_SES_CLOSETABS && ti != NULL) {
-		for (;;) {
-			tt = TAILQ_FIRST(&tabs);
-			if (tt != ti) {
-				delete_tab(tt);
-				continue;
-			}
-			delete_tab(tt);
-			break;
-		}
-		recalc_tabs();
-	}
-
 	rv = 0;
 done:
 	if (f)