[U-Boot] [PATCH 2/3] tools/proftool: add missing definition
Jeroen Hofstee
jeroen at myspectrum.nl
Mon Jul 1 20:45:19 CEST 2013
Hello Andreas,
On 06/30/2013 01:15 PM, Andreas Bießmann wrote:
> BSD (like OS X) variants of regex.h do not declare REG_NOERROR, add a simple
> define for them.
>
> Signed-off-by: Andreas Bießmann <andreas.devel at googlemail.com>
> ---
>
> +#ifndef REG_NOERROR
> +/* BSD regex.h do not expose REG_NOERROR */
> +# define REG_NOERROR 0
> +#endif
> +
I think a neater solutions is to actually remove the REG_NOERROR.
From man regexec, GNU 2011-09-27: "regexec() returns zero for a
successful match or REG_NOMATCH for failure.". Opengroup specs
will mention the same. REG_NOERROR is not mentioned at all.
e.g.:
if (err) {
regex_report_error(&item->regex, err, "match",
item->name);
break;
}
should do the job in a portable way (and reads a bit better,
as well). But this is only a cosmetic comment, the patch by
itself should do the job.
Regards,
Jeroen
p.s. Strictly speaking it is dead code actually...
More information about the U-Boot
mailing list