summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-10-06 02:48:31 +0000
committerZac Medico <zmedico@gentoo.org>2006-10-06 02:48:31 +0000
commite7c30c40488ed373109dfdabd316d87d92b33655 (patch)
tree0142370d8aca14debbb0abfcdc138bd6f26d099b
parentd6af3cdb55d7a894a89ca2bcf5a08cb85deb2981 (diff)
downloadportage-e7c30c40488ed373109dfdabd316d87d92b33655.tar.gz
portage-e7c30c40488ed373109dfdabd316d87d92b33655.tar.bz2
portage-e7c30c40488ed373109dfdabd316d87d92b33655.zip
For bug #14215, put the shlex parser in posix mode so that it properly recognizes escaped quotes.
svn path=/main/trunk/; revision=4602
-rw-r--r--pym/portage_util.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pym/portage_util.py b/pym/portage_util.py
index c329bc225..52cbaa34c 100644
--- a/pym/portage_util.py
+++ b/pym/portage_util.py
@@ -235,7 +235,7 @@ def getconfig(mycfg,tolerant=0,allow_sourcing=False):
raise
return None
try:
- lex=shlex.shlex(f)
+ lex = shlex.shlex(f, posix=True)
lex.wordchars=string.digits+string.letters+"~!@#$%*_\:;?,./-+{}"
lex.quotes="\"'"
if allow_sourcing:
@@ -244,7 +244,7 @@ def getconfig(mycfg,tolerant=0,allow_sourcing=False):
key=lex.get_token()
if key == "export":
key = lex.get_token()
- if (key==''):
+ if key is None:
#normal end of file
break;
equ=lex.get_token()
@@ -267,7 +267,7 @@ def getconfig(mycfg,tolerant=0,allow_sourcing=False):
else:
return mykeys
val=lex.get_token()
- if (val==''):
+ if val is None:
#unexpected end of file
#lex.error_leader(self.filename,lex.lineno)
if not tolerant: