Re: [PATCH v14 04/13] ref-filter: implement an `align` atom

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

 



Karthik Nayak <karthik.188@xxxxxxxxx> writes:

> Like this:
>
>  else if (skip_prefix(name, "align", &valp)) {
>             struct align *align = &v->u.align;
>             struct strbuf **s;
>
>             if (valp[0] != ':')
>                 die(_("format: usage %%(align:<width>,<position>)"));
>             else
>                 valp++;
>             ......
>             ........
> }

Checking the string's correctness as you read it seems good to me, yes.

But as you say, you should make this a bit more generic, for example by
putting your "if/else" in a helper function, that other atoms could use.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]