From 8607a53d421c2549d92965788e06aaa9000074a6 Mon Sep 17 00:00:00 2001
From: Gergely Imreh <imrehg@gmail.com>
Date: Sat, 14 Feb 2009 01:01:07 +0800
Subject: [PATCH 2/2] Fix: FS#13122 - simpler commented line removal

Changed the way commented lines are removed. Previously it happened
only within bracketed sections, now in every line all text on the
right of a # character is removed (together with the #).
---
 web/html/pkgsubmit.php |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index 3913e69..d7031ce 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -72,12 +72,12 @@ if ($_COOKIE["AURSID"]):
 			$fp = fopen($pkg_dir."/PKGBUILD", "r");
 			$line_no = 0;
 			$lines = array();
-			$decomment = array();
 			$continuation_line = 0;
 			$current_line = "";
 			$paren_depth = 0;
 			while (!feof($fp)) {
 				$line = trim(fgets($fp));
+				$line = preg_replace('/#.*/', "", $line);
 				$char_counts = count_chars($line, 0);
 				$paren_depth += $char_counts[ord('(')] - $char_counts[ord(')')];
 				if (substr($line, strlen($line)-1) == "\\") {
@@ -89,8 +89,6 @@ if ($_COOKIE["AURSID"]):
 					# assumed continuation
 					# continue appending onto existing line_no
 					#
-					$decomment = explode("#",$line,2);
-					$line = $decomment[0];
 					$current_line .= $line . " ";
 					$continuation_line = 1;
 				} else {
-- 
1.6.1.3

