Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ECCE8F2EC for ; Wed, 27 Mar 2013 02:41:10 +0000 (UTC) Received: (qmail 84165 invoked by uid 500); 27 Mar 2013 02:41:10 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 84140 invoked by uid 500); 27 Mar 2013 02:41:10 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 84130 invoked by uid 99); 27 Mar 2013 02:41:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Mar 2013 02:41:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Mar 2013 02:41:08 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id AF4302388847; Wed, 27 Mar 2013 02:40:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1461393 - /subversion/trunk/tools/hook-scripts/control-chars.py Date: Wed, 27 Mar 2013 02:40:47 -0000 To: commits@subversion.apache.org From: danielsh@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130327024047.AF4302388847@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: danielsh Date: Wed Mar 27 02:40:47 2013 New Revision: 1461393 URL: http://svn.apache.org/r1461393 Log: control-chars.py: defensive coding in the error path. * tools/hook-scripts/control-chars.py (main): Gracefully handle error strings that don't match our regexp. (Not tested.) Modified: subversion/trunk/tools/hook-scripts/control-chars.py Modified: subversion/trunk/tools/hook-scripts/control-chars.py URL: http://svn.apache.org/viewvc/subversion/trunk/tools/hook-scripts/control-chars.py?rev=1461393&r1=1461392&r2=1461393&view=diff ============================================================================== --- subversion/trunk/tools/hook-scripts/control-chars.py (original) +++ subversion/trunk/tools/hook-scripts/control-chars.py Wed Mar 27 02:40:47 2013 @@ -101,7 +101,11 @@ def main(ignored_pool, argv): # If we get a file not found error then some file has a newline in it and # fsfs's own transaction is now corrupted. if e.apr_err == svn.core.SVN_ERR_FS_NOT_FOUND: - path = re.search("path '(.*?)'", e.message).group(1) + match = re.search("path '(.*?)'", e.message) + if not match: + sys.stderr.write(repr(e)) + return 2 + path = match.group(1) sys.stderr.write("Path name that contains '%s' has a newline." % path) return 3 # fs corrupt error probably means that there is probably both