Documentation 40/8540/3
Sylvestre Ledru [Sat, 4 Aug 2012 19:58:43 +0000 (21:58 +0200)]
=============

* Bug #11641 fixed - Parsing of the CHAPTER files was too strict.

Change-Id: I40a0416e36d982c996abafca475f0bac163405ee

scilab/CHANGES_5.4.X
scilab/modules/helptools/macros/xmltoformat.sci

index 2513a08..409afd6 100644 (file)
@@ -34,6 +34,7 @@ Bug Fixes
 
 * Bug #11628 fixed - Clearing a shortcut did not work is Preferences.
 
+* Bug #11641 fixed - In xmltoformat, parsing of the CHAPTER files was too strict.
 
 
             Changes between version 5.4.0-beta-1 and 5.4.0-beta-2 of Scilab
index 8f3cff7..246d4ff 100644 (file)
@@ -1236,16 +1236,16 @@ function desc_out = x2f_read_CHAPTER(file_in)
         end
 
         // First case : new field
-        if regexp(FILETOPARSE(i),"/^[a-zA-Z][a-zA-Z0-9_]*\s=\s/","o") == 1 then
-            current_field_length    = regexp(FILETOPARSE(i),"/\s=\s/","o")
-            current_field           = part(FILETOPARSE(i),1:current_field_length-1);
-            current_value           = part(FILETOPARSE(i),current_field_length+3:length(FILETOPARSE(i)));
+        if regexp(FILETOPARSE(i),"/^[a-zA-Z][a-zA-Z0-9_]*\s*=\s*/","o") == 1 then
+            [current_field_start, current_field_end] = regexp(FILETOPARSE(i),"/\s*=\s*/","o")
+            current_field           = part(FILETOPARSE(i),1:current_field_start-1);
+            current_value           = part(FILETOPARSE(i),current_field_end+1:length(FILETOPARSE(i)));
             desc_out(current_field) = current_value;
             continue;
         end
 
         // Third case : Blank line
-        if length(FILETOPARSE(i)) == 0 then
+        if length(stripblanks(FILETOPARSE(i))) == 0 then
             continue;
         end