summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvangelos Foutras <foutrelis@gmail.com>2008-11-24 01:34:55 +0100
committerLoui Chang <louipc.ist@gmail.com>2008-12-20 19:25:44 +0100
commitfb1c41c6c6572f763d8902b2358ec1b876928d28 (patch)
tree1e43bcb700a7f7fb866f6537dc5e7f5558813127
parent07a27f2f1dc6b6d168c4f443c9f6c8508ff5a288 (diff)
downloadaur-fb1c41c6c6572f763d8902b2358ec1b876928d28.tar.gz
aur-fb1c41c6c6572f763d8902b2358ec1b876928d28.tar.xz
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>
-rw-r--r--web/html/pkgsubmit.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index 93d44562..0e4f448b 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
#