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; }