From 341d17b5a156386dac56b2235ce8acf237333630 Mon Sep 17 00:00:00 2001 From: jchu Date: Tue, 14 Dec 2004 23:08:07 +0000 Subject: added code to handle assumed line continuations and cases --- web/html/pkgsubmit.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'web/html') diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 1b986ccf..f22fe677 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -188,11 +188,18 @@ if ($_COOKIE["AURSID"]) { $current_line = ""; while (!feof($fp)) { $line = trim(fgets($fp)); + $char_counts = count_chars($line, 0); 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(')')]) { + # assumed continuation + # continue appending onto existing line_no + # + $current_line .= $line . " "; + $continuation_line = 1; } else { # maybe the last line in a continuation, or a standalone line? # @@ -219,7 +226,6 @@ if ($_COOKIE["AURSID"]) { # $seen_build_function = 0; while (list($k, $line) = each($lines)) { - $lparts = explode("=", $line); if (count($lparts) == 2) { # this is a variable/value pair, strip out @@ -286,7 +292,9 @@ if ($_COOKIE["AURSID"]) { $new_pkgbuild = array(); while (list($k, $v) = each($pkgbuild)) { $v = str_replace("\$pkgname", $pkgname_var, $v); + $v = str_replace("\${pkgname}", $pkgname_var, $v); $v = str_replace("\$pkgver", $pkgver_var, $v); + $v = str_replace("\${pkgver}", $pkgver_var, $v); $new_pkgbuild[$k] = $v; } } -- cgit v1.2.3-24-g4f1b