On Thu, Jan 15, 2026 at 07:17:23PM -0800, Alison Schofield wrote:
> On Thu, Jan 15, 2026 at 03:54:54PM -0800, Marc Herbert wrote:
> > Hi Alison,
> > 
> > Alison Schofield <[email protected]> writes:
> > >   argc = parse_options(argc, argv, options, u, 0);
> > > - if (argc > 0)
> > > -         device = basename(argv[0]);
> > > + if (argc > 0) {
> > > +         device = strrchr(argv[0], '/');
> > > +         device = device ? device + 1 : argv[0];
> > > + }
> > >  
> > 
> > 
> > 1. I would add a one-line comment in both places, something like "This
> > is like basename but without the bugs and portability issues" because:
> > 
> >   1.a) It's much faster to read such a comment than understanding the code.
> >   1.b) Not everyone knows how much of GNU/POSIX disaster is "basename".
> >        You summarized it well in the commit message but it's unlikely
> >        anyone will fetch the commit message from git without such a comment.
> > 
> >   To avoid duplicating the comment, a small "my_basename()" inline
> >   function would not hurt while at it.
> 
> Thanks for the review.
> 
> I'm headed down the Dan suggested path of adding a helper.
  meant to say - Marc and Dan suggested path :)


Reply via email to