Re: [PATCH v2] builtin/log.c: prepend "RFC" on --rfc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Taylor Blau <me@xxxxxxxxxxxx> writes:

> I am not super familiar with this code, so could easily be missing
> something here, but I think that you can do this in a more direct way
> like so:
> ...
>  static int rfc_callback(const struct option *opt, const char *arg, int unset)
>  {
> +	free(subject_prefix);
> +	subject_prefix = xstrfmt("RFC %s", revs->subject_prefix);

As Phillip Wood pointed out, this approach no longer works once
"--rfc" is "no matter what subject-prefix says, we prepend RFC in
front", as the order of command line flags is not forced.  At this
point, revs->subject_prefix may be one value (or worse, even not
initialized), and then --subject-prefix=<new-prefix> command line
argument may yet to be parsed.

> +	return subject_prefix_callback(opt, subject_prefix, unset);
>  }

So, we'd most likely need to treat subject_prefix and rfc as two
separate strings while parse_options() is doing its work, and then
after that prepend the rfc string, if set, to the final version of
the subject_prefix string.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux