More robust reading of VCComponents.dat. (Chad Austin)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 8 Feb 2004 15:56:52 +0000 (15:56 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 8 Feb 2004 15:56:52 +0000 (15:56 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@893 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Tool/msvc.py

index 18181fc5888622b32d37c6c335966e70d51966a6..f7d0a2269275dd92cd4604845a12df371327781f 100644 (file)
@@ -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
index ace9cfb54d2c100764e7743c227582c335f3cbc8..40f8b40725e99c57b8da7a39434112cb68a40c83 100644 (file)
@@ -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: