2016-01-22 23:18 GMT+03:00 Martijn van Duren <openbsd+t...@list.imperialat.at>:
> Hello tech@,
>
> Attached are 6 patches to do some initial cleanup in vi (these complement
> the perr patch that got comitted earlier). They are intended to be applied
> in sequential order, because there may be slight overlap, but they (almost)
> all do more or less the same thing: Remove custom code with their libc
> counterpart.
>
> 1) 1_vi_prefer_errx.diff: don't use fprintf+exit if we can call errx

Okay.

> 2) 2_vi_remove_v_estr.diff: v_estr is practically warn and warnx combined.

Okay.

> 3) 3_vi_remove_progname.diff: Don't keep a copy of the progname in memory,
> use getprogname instead.

Okay.

> 4) 4_vi_remove_tail.diff: Use basename instead of tail

The basename(3) returns a pointer to internal buffer, which could be
overwritten by subsequent calls. Also, basename(3) could return ".",
it compacts slashes and so on... Did you check all those differences?

Also, it looks like you have a typo in vi/vs_refresh.c.

> 5) 5_vi_remove_v_strdup.diff: Use strdup instead of v_strdup.

Not okay: MALLOC macro prints information message to user, while
patched version isn't. I think refactoring shouldn't have such visible
impact on functionality, to make sure nothing breaks.

> 6) 6_vi_use_tmp.diff: /var/tmp is dead, long live /tmp

Okay.

> The first four patches have also been accepted by the nvi2 project.
> I haven't offered the fifth patch, since they also included a v_wstrdup
> function which takes CHAR_T, which in their code can be an u_char or a
> wchar_t depending on the compile options and I don't want to get entangled
> in there.
> The 6th patch should speak for itself.

Cool, thank you for work!

--
  WBR,
  Vadim Zhukov

Reply via email to