From fb1c41c6c6572f763d8902b2358ec1b876928d28 Mon Sep 17 00:00:00 2001 From: Evangelos Foutras Date: Mon, 24 Nov 2008 02:34:55 +0200 Subject: Fix PKGBUILD source array parsing. Fix for FS#11132 - AUR fails to parse multiline source array Signed-off-by: Evangelos Foutras Signed-off-by: Loui Chang --- web/html/pkgsubmit.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'web/html') diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 93d4456..0e4f448 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -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 # -- cgit v1.2.3-54-g00ecf