Skip to content

Commit 1a4775a

Browse files
committed
Bug fix pointer clobber
1 parent 13761b2 commit 1a4775a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

link-parser/lg_readline.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,17 @@ void find_history_filepath(const char *dictname, const char *argv0,
7474
dictpref[strcspn(dictpref, ":")] = '\0';
7575

7676
// Find the location of the history file.
77-
const char *hfile = xdg_make_path(XDG_BD_STATE, "%s/%s%s", xdg_prog,
78-
dictpref, history_file_basename);
77+
history_file = xdg_make_path(XDG_BD_STATE, "%s/%s%s", xdg_prog,
78+
dictpref, history_file_basename);
7979
free(dictpref);
8080

81-
if (NULL == hfile)
81+
if (NULL == history_file)
8282
{
8383
prt_error("Warning: xdg_get_home(XDG_BD_STATE) failed; "
8484
"input history will not be supported.\n");
8585
history_file = strdup("dev/null");
8686
}
8787

88-
history_file = hfile;
8988
if (get_verbosity() == D_USER_FILES)
9089
prt_error("Debug: Using history file \"%s\"\n", history_file);
9190
}

0 commit comments

Comments
 (0)