mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-03-03 19:55:47 +03:00
Fix for an Issue #409
This commit is contained in:
parent
6acb2480b8
commit
44a46d2b10
|
@ -1510,6 +1510,7 @@ def isHexEncodedString(subject):
|
||||||
|
|
||||||
return re.match(r"\A[0-9a-fA-Fx]+\Z", subject) is not None
|
return re.match(r"\A[0-9a-fA-Fx]+\Z", subject) is not None
|
||||||
|
|
||||||
|
@cachedmethod
|
||||||
def getConsoleWidth(default=80):
|
def getConsoleWidth(default=80):
|
||||||
"""
|
"""
|
||||||
Returns console width
|
Returns console width
|
||||||
|
@ -1520,11 +1521,15 @@ def getConsoleWidth(default=80):
|
||||||
if os.getenv("COLUMNS", "").isdigit():
|
if os.getenv("COLUMNS", "").isdigit():
|
||||||
width = int(os.getenv("COLUMNS"))
|
width = int(os.getenv("COLUMNS"))
|
||||||
else:
|
else:
|
||||||
output = execute("stty size", shell=True, stdout=PIPE, stderr=PIPE).stdout.read()
|
try:
|
||||||
items = output.split()
|
process = execute("stty size", shell=True, stdout=PIPE, stderr=PIPE)
|
||||||
|
stdout, _ = process.communicate()
|
||||||
|
items = stdout.split()
|
||||||
|
|
||||||
if len(items) == 2 and items[1].isdigit():
|
if len(items) == 2 and items[1].isdigit():
|
||||||
width = int(items[1])
|
width = int(items[1])
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
|
||||||
if width is None:
|
if width is None:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user