mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Fix PKGBUILD source array parsing.
Fix for FS#11132 - AUR fails to parse multiline source array Signed-off-by: Evangelos Foutras <foutrelis@gmail.com> Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
parent
07a27f2f1d
commit
fb1c41c6c6
1 changed files with 3 additions and 1 deletions
|
@ -73,15 +73,17 @@ if ($_COOKIE["AURSID"]):
|
|||
$lines = array();
|
||||
$continuation_line = 0;
|
||||
$current_line = "";
|
||||
$paren_depth = 0;
|
||||
while (!feof($fp)) {
|
||||
$line = trim(fgets($fp));
|
||||
$char_counts = count_chars($line, 0);
|
||||
$paren_depth += $char_counts[ord('(')] - $char_counts[ord(')')];
|
||||
if (substr($line, strlen($line)-1) == "\\") {
|
||||
# continue appending onto existing line_no
|
||||
#
|
||||
$current_line .= substr($line, 0, strlen($line)-1);
|
||||
$continuation_line = 1;
|
||||
} elseif ($char_counts[ord('(')] > $char_counts[ord(')')]) {
|
||||
} elseif ($paren_depth > 0) {
|
||||
# assumed continuation
|
||||
# continue appending onto existing line_no
|
||||
#
|
||||
|
|
Loading…
Add table
Reference in a new issue