You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2013/03/27 03:40:47 UTC

svn commit: r1461393 - /subversion/trunk/tools/hook-scripts/control-chars.py

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