AUR web interface

Tasklist

FS#37618 - False handling of # in Strings

Attached to Project: AUR web interface
Opened by Armin Fasold (bebna) - Sunday, 03 November 2013, 12:08 GMT
Last edited by Lukas Fleischer (lfleischer) - Saturday, 11 January 2014, 12:22 GMT
Task Type Bug Report
Category PKGBUILD Parser
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 2.2.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

AUR showed me a wrong description in PKGBUILD who contained this line:

pkgdesc="A free, fast and small automatic formatter for C, C++, C#, and Java source code."

Which resulted to this on the package page:

Description: "A free, fast and small automatic formatter for C, C++, C

Changing C# to C-Sharp fixed this wrong behaviour and made clear that even in escaped strings line comments will be removed. I don't think this is intentional and found the bug in /web/html/pkgsubmit.php#n136

$line = preg_replace('/\s*#.*/', '', $line);

Changing the regex to /#[^'"]+$/m should fix it in the most cases. A better way would be using multiple a bigger and more complex regex using multiple alternatives to differentiate comments in and outside of strings or don't use regex for it in the first place.

Greetings.
This task depends upon

Closed by  Lukas Fleischer (lfleischer)
Saturday, 11 January 2014, 12:22 GMT
Reason for closing:  Won't fix
Additional comments about closing:  Use .AURINFO instead.
Comment by Lukas Fleischer (lfleischer) - Sunday, 03 November 2013, 14:41 GMT
Please use .AURINFO for this kind of things. We won't improve the AUR PKGBUILD parser.

Loading...