Re: [PATCH v4 38/44] builtin-am: support and auto-detect StGit patches

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

 



On Mon, Jun 29, 2015 at 4:42 PM, Stefan Beller <sbeller@xxxxxxxxxx> wrote:
> On Sun, Jun 28, 2015 at 7:06 AM, Paul Tan <pyokagan@xxxxxxxxx> wrote:
>> +/**
>> + * Returns true if `str` consists of only whitespace, false otherwise.
>> + */
>> +static int str_isspace(const char *str)
>> +{
>> +       while (*str)
>> +               if (!isspace(*(str)++))
>> +                       return 0;
>
> (nit:)
> This looks a bit weird when first reading it, maybe combine the 2 conditions?
>
>     while (*str && !isspace(*(str)++))
>         return 0;
>
> The isspace checks for both tabs and whitespaces IIRC, so SP TAB SP
> would be valid here
> (returning 1).

Ugh. Please don't break the logic with this strange and bogus transformation.

If you really want it to read more idiomatically, try:

    for (; *s; s++)
        if (!isspace(*s))
            return 0;
--
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]