mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
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
This commit is contained in:
13
patch.py
13
patch.py
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user