Re: [PATCH] Listing cpp source code in mainless binaries

Andreas Schwab
2008-06-30T14:25:04Z

Luis Machado <luisgpm@linux.vnet.ibm.com> writes:

> @@ -260,14 +261,15 @@
> {
> const char *name = s->filename;
> int len = strlen (name);
> - if (!(len > 2 && strcmp(&name[len - 2], ".h") == 0))
> + if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0
> + || strcmp (name, "<<C++-namespaces>>") == 0)))

Indentation is wrong here.

> @@ -275,7 +277,8 @@
> {
> const char *name = ps->filename;
> int len = strlen (name);
> - if (!(len > 2 && strcmp (&name[len - 2], ".h") == 0))
> + if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0
> + || strcmp (name, "<<C++-namespaces>>") == 0)))

Likewise. Alternatively, drop the inner pair of parens, the semantics
will be the same.

Andreas.

--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃŸe 5, 90409 NÃ¼rnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."