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): ...@@ -54,10 +54,15 @@ class FilePatchBase(object):
if i in filename: if i in filename:
raise UnsupportedPatchFormat( raise UnsupportedPatchFormat(
filename, 'Can\'t use \'%s\' in filename.' % i) filename, 'Can\'t use \'%s\' in filename.' % i)
for i in ('/', 'CON', 'COM'): if filename.startswith('/'):
if filename.startswith(i): raise UnsupportedPatchFormat(
raise UnsupportedPatchFormat( filename, 'Filename can\'t start with \'/\'.')
filename, 'Filename can\'t start with \'%s\'.' % i) 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 return filename
def set_relpath(self, relpath): 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