Browse Source

tinyrl: Fix history restoring

Serj Kalichev 2 months ago
parent
commit
f0c3e832fb
2 changed files with 2 additions and 2 deletions
  1. 1 1
      tinyrl/hist/hist.c
  2. 1 1
      tinyrl/tinyrl/tinyrl.c

+ 1 - 1
tinyrl/hist/hist.c

@@ -208,7 +208,7 @@ int hist_restore(hist_t *hist)
 	// Remove old entries from list
 	hist_clear(hist);
 
-	f = faux_file_open(hist->fname, O_CREAT | O_TRUNC | O_WRONLY, 0644);
+	f = faux_file_open(hist->fname, O_RDONLY, 0);
 	if (!f)
 		return -1;
 

+ 1 - 1
tinyrl/tinyrl/tinyrl.c

@@ -101,7 +101,7 @@ void tinyrl_free(tinyrl_t *tinyrl)
 
 	tty_restore_mode(tinyrl);
 
-	hist_save(tinyrl->hist);
+	tinyrl_hist_save(tinyrl);
 	hist_free(tinyrl->hist);
 
 	vt100_free(tinyrl->term);