From f8b869f360b8ae61b0adf7884eb4f75c1e7880f5 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Sun, 8 Feb 2004 15:56:52 +0000 Subject: [PATCH] More robust reading of VCComponents.dat. (Chad Austin) git-svn-id: http://scons.tigris.org/svn/scons/trunk@893 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 2 ++ src/engine/SCons/Tool/msvc.py | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 18181fc5..f7d0a226 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -31,6 +31,8 @@ RELEASE 0.95 - XXX - Work around Cygwin Python's silly fiction that it's using a case-sensitive file system. + - More robust handling of data in VCComponents.dat. + From Kerim Borchaev: - Fix a typo in a msvc.py's registry lookup: "VCComponents.dat", not diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py index ace9cfb5..40f8b407 100644 --- a/src/engine/SCons/Tool/msvc.py +++ b/src/engine/SCons/Tool/msvc.py @@ -77,14 +77,16 @@ def _parse_msvc7_overrides(version): found = 0 while line: line.strip() - if found == 1: - (key, val) = line.split('=',1) - key = key.replace(' Dirs','') - dirs[key.upper()] = val if line.find(r'[VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories]') >= 0: found = 1 - if line == '': + elif line == '' or line[:1] == '[': found = 0 + elif found == 1: + kv = line.split('=', 1) + if len(kv) == 2: + (key, val) = kv + key = key.replace(' Dirs','') + dirs[key.upper()] = val line = f.readline() f.close() else: -- 2.26.2