dawnbeen / c_formatter_42

C language formatter for 42 norminette
GNU General Public License v3.0
165 stars 17 forks source link

`insert_void` not working for functions returning a pointer #37

Closed younesaassila closed 1 year ago

younesaassila commented 1 year ago

Works fine for functions returning normal type:

Before:

char test(){}

After:

char    test(void)
{
}

Doesn't work for functions returning a pointer:

Before:

char *test(){}

After:

char    *test()
{
}

Expected:

char    *test(void)
{
}

Fix: Edit regexp to work for function declarations with any number of * characters between type and function name