> I've also noticed that since startupfile() returns static memory
> errors in -u would report the wrong path (ttykeymapinit() calls
> startupfile() itself) so I'm changing it to use a caller provided
> buffer for the path. tbf i don't completely like it and it also
> causes some churn in the diff in startupfile().
I'm not offended by it. It reads fine.
> Index: main.c
[...]
> @@ -159,8 +162,10 @@ main(int argc, char **argv)
> update(CMODE);
>
> /* user startup file. */
> - if ((cp = startupfile(NULL, conffile)) != NULL)
> - (void)load(cp);
> + if (ffp) {
Could you check this against NULL
if (ffp != NULL) {
Then it's ok.
> + (void)load(ffp, file);
> + ffclose(ffp, NULL);
> + }
>
> if (batch)
> return (0);