Re: [PATCH v2 1/1] config: learn the --stdin option for instructions

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

 



On Mon, Jan 27, 2020 at 11:21 AM Zeger-Jan van de Weg <git@xxxxxxxxxxxxx> wrote:

> +static void update_config_stdin()
> +{
> +       struct strbuf input = STRBUF_INIT;
> +       const char *next;
> +       const char *max_char;
> +
> +       if (strbuf_read(&input, 0, 1000) < 0)
> +               die_errno(_("could not read from stdin"));
> +       next = input.buf;
> +
> +       max_char = input.buf + input.len;
> +       while(next < max_char) {

Nit: space missing between "while" and "(".

> +               if (*next == term)
> +                       die(_("empty command in input"));
> +               else if (isspace(*next))
> +                       die(_("whitespace before command"));
> +               else if (skip_prefix(next, "set ", &next))
> +                       next = parse_cmd_set(next, max_char);
> +               else if (skip_prefix(next, "unset ", &next))
> +                       next = parse_cmd_unset(next, max_char);
> +               else
> +                       die(_("unknown command %s"), next);
> +       }
> +
> +       strbuf_release(&input);
> +}

Thanks,
Christian.



[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