From: Zac Medico Date: Fri, 6 Oct 2006 02:48:31 +0000 (-0000) Subject: For bug #14215, put the shlex parser in posix mode so that it properly recognizes... X-Git-Tag: v2.1.2~703 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e7c30c40488ed373109dfdabd316d87d92b33655;p=portage.git For bug #14215, put the shlex parser in posix mode so that it properly recognizes escaped quotes. svn path=/main/trunk/; revision=4602 --- 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: