fail is argument is not oshash and not found, fixes #2793

This commit is contained in:
j 2015-05-26 22:56:57 +02:00
parent 0e31ada156
commit 2a76954018
1 changed files with 10 additions and 0 deletions

View File

@ -115,6 +115,13 @@ def ignore_file(client, path):
return True
return False
def is_oshash(oshash):
try:
int(oshash, 16)
except:
return False
return len(oshash) == 16
def hide_cursor():
sys.stdout.write("\033[?25l")
sys.stdout.flush()
@ -654,6 +661,9 @@ class Client(object):
'filename': filename
})
data.append(oshash)
elif not is_oshash(arg):
print 'file not found "%s"' % arg
sys.exit(1)
else:
data.append(arg)
files = []