From 48124fdba49483676819252b15d27c1f534f0156 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 18 Sep 2019 14:18:48 +0200 Subject: [PATCH] tweaks: use a more effecient way to skip storing an empty file name Position history refers only to actual files, so when the filename is blank... there is nothing that needs to be remembered. --- src/history.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/history.c b/src/history.c index cd536074..59d83fae 100644 --- a/src/history.c +++ b/src/history.c @@ -528,7 +528,7 @@ void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos) poshiststruct *posptr, *theone, *posprev = NULL; char *fullpath = get_full_path(filename); - if (fullpath == NULL || fullpath[strlen(fullpath) - 1] == '/') { + if (fullpath == NULL || *filename == '\0') { free(fullpath); return; }