Browse Source

cmScore.c : Fixed bug in _cmScParseFile() where _cmScParseSectionColumn()

overwrote 'rc' and thereby prevented the functio from returning the correct result code on fail.
master
kevin 11 years ago
parent
commit
e6933b61d2
1 changed files with 20 additions and 17 deletions
  1. 20
    17
      app/cmScore.c

+ 20
- 17
app/cmScore.c View File

@@ -1306,27 +1306,30 @@ cmScRC_t _cmScParseFile( cmSc_t* p, cmCtx_t* ctx, const cmChar_t* fn )
1306 1306
         break;
1307 1307
     }
1308 1308
     
1309
-    if( secs != DBL_MAX )
1310
-      cur_secs = secs;
1309
+    if( rc == kOkScRC )
1310
+    {
1311
+      if( secs != DBL_MAX )
1312
+        cur_secs = secs;
1311 1313
 
1312
-    // form the section list
1313
-    if( j > 0 )
1314
-      if((rc = _cmScParseSectionColumn(p,i,j-1,p->sectList)) != kOkScRC )
1315
-        break;
1314
+      // form the section list
1315
+      if( j > 0 )
1316
+        if((rc = _cmScParseSectionColumn(p,i,j-1,p->sectList)) != kOkScRC )
1317
+          break;
1316 1318
 
1317
-    // the bar lines don't have times so set the time of the bar line to the
1318
-    // time of the first event in the bar.
1319
-    if( barEvtIdx != cmInvalidIdx && secs != DBL_MAX )
1320
-    {
1321
-      assert( p->array[ barEvtIdx ].type == kBarEvtScId );
1322
-      p->array[ barEvtIdx ].secs = secs;
1319
+      // the bar lines don't have times so set the time of the bar line to the
1320
+      // time of the first event in the bar.
1321
+      if( barEvtIdx != cmInvalidIdx && secs != DBL_MAX )
1322
+      {
1323
+        assert( p->array[ barEvtIdx ].type == kBarEvtScId );
1324
+        p->array[ barEvtIdx ].secs = secs;
1323 1325
 
1324
-      // handle the case where the previous bar had no events
1325
-      // BUG BUG BUG this is a hack which will fail if the first bar does not have events.
1326
-      if( barEvtIdx>=1 && p->array[ barEvtIdx-1].type == kBarEvtScId )
1327
-        p->array[ barEvtIdx-1].secs = secs;
1326
+        // handle the case where the previous bar had no events
1327
+        // BUG BUG BUG this is a hack which will fail if the first bar does not have events.
1328
+        if( barEvtIdx>=1 && p->array[ barEvtIdx-1].type == kBarEvtScId )
1329
+          p->array[ barEvtIdx-1].secs = secs;
1328 1330
 
1329
-      barEvtIdx = cmInvalidIdx;
1331
+        barEvtIdx = cmInvalidIdx;
1332
+      }
1330 1333
     }
1331 1334
     
1332 1335
   }

Loading…
Cancel
Save