Commit 8770f48d authored by sullivan@chromium.org's avatar sullivan@chromium.org

Fix filename checks

BUG=

Review URL: https://codereview.chromium.org/1160663007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295430 0039d316-1c4b-4281-b951-d872f2087c98
parent 832d51ee
......@@ -54,10 +54,15 @@ class FilePatchBase(object):
if i in filename:
raise UnsupportedPatchFormat(
filename, 'Can\'t use \'%s\' in filename.' % i)
for i in ('/', 'CON', 'COM'):
if filename.startswith(i):
raise UnsupportedPatchFormat(
filename, 'Filename can\'t start with \'%s\'.' % i)
if filename.startswith('/'):
raise UnsupportedPatchFormat(
filename, 'Filename can\'t start with \'/\'.')
if filename == 'CON':
raise UnsupportedPatchFormat(
filename, 'Filename can\'t be \'CON\'.')
if re.match('COM\d', filename):
raise UnsupportedPatchFormat(
filename, 'Filename can\'t be \'%s\'.' % filename)
return filename
def set_relpath(self, relpath):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment