PlayOnLinux/POL-POM-4 — pull request #2 by petchema (2012-01-21 15:24:15+00:00)
Title: POL_Shortcut_InsertBeforeWine insensitive to special chars (bug #602)

Hi all,
One problem with current implementation of POL_Shortcut_InsertBeforeWine is that the line passed as argument is inserted in the middle of some Perl code; So several special characters get interpreted and need to be escaped, forward slashes also need to be escaped because it's used as regexp separator in the code.

The fix is to pass this string as a value to the Perl script (I used an environment variable), so it can use it without interpreting it. I pondered interpreting explicitly "\n" as line separator, but finally decided that it wasn't a good idea: it makes code mode complicated, less transparent (maybe someone will want to insert a line with \n?), and there's a way around: use POL_Shortcut_InsertBeforeWine once per line to insert.

I've seen very few usages of POL_Shortcut_InsertBeforeWine in the forum, and none in script repository, so this change should not break any existing published scripts.

Regards,
Pierre.