[Cocci] How to match &(ttyname(0))[5]

Andreas.Aaen at tieto.com Andreas.Aaen at tieto.com
Fri Nov 27 10:08:24 CET 2009


Hi,

I an porting an application from one Unix flavor to another. I have found expressions in the code like this:

&(ttyname(0))[5]

In some flavors of Unix this might give you a unique number, but it depend very much of the naming convention, so I wan't to find all these.
How do I find this?

$$
expression E1;
$$
ttyname(E1)

does find all uses of ttyname, but

$$
expression E1;
$$
&(ttyname(E1))[5]

doesn't match anything
What did I express wrongly in Coccinelle?

Regards
Andreas Bach Aaen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.diku.dk/pipermail/cocci/attachments/20091127/6b7d808d/attachment.html


More information about the Cocci mailing list