Changeset 5451
- Timestamp:
- 10/31/09 18:46:13 (4 years ago)
- Files:
-
- 1 modified
-
luci/trunk/libs/lmo/src/lmo_po2lmo.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
luci/trunk/libs/lmo/src/lmo_po2lmo.c
r5035 r5451 100 100 memset(val, 0, sizeof(val)); 101 101 102 while( (NULL != fgets(line, sizeof(line), in)) || (state >= 2&& feof(in)) )102 while( (NULL != fgets(line, sizeof(line), in)) || (state >= 3 && feof(in)) ) 103 103 { 104 104 if( state == 0 && strstr(line, "msgid \"") == line ) … … 109 109 die("Syntax error in msgid"); 110 110 case 0: 111 continue;112 default:113 111 state = 1; 114 }115 }116 else if( state == 1 && strstr(line, "msgstr \"") == line )117 {118 switch(extract_string(line, val, sizeof(val)))119 {120 case -1:121 die("Syntax error in msgstr");122 case 0:123 state = 2;124 112 break; 125 113 default: 126 state = 3; 127 } 128 } 129 else if( state == 2 ) 114 state = 2; 115 } 116 } 117 else if( state == 1 || state == 2 ) 118 { 119 if( strstr(line, "msgstr \"") == line || state == 2 ) 120 { 121 switch(extract_string(line, val, sizeof(val))) 122 { 123 case -1: 124 state = 4; 125 break; 126 case 0: 127 state = 2; 128 break; 129 default: 130 state = 3; 131 } 132 } 133 else 134 { 135 switch(extract_string(line, tmp, sizeof(tmp))) 136 { 137 case -1: 138 state = 4; 139 break; 140 default: 141 strcat(key, tmp); 142 } 143 } 144 } 145 else if( state == 3 ) 130 146 { 131 147 switch(extract_string(line, tmp, sizeof(tmp))) 132 148 { 133 149 case -1: 134 state = 3;150 state = 4; 135 151 break; 136 152 default: … … 138 154 } 139 155 } 140 else if( state == 3)156 else if( state == 4 ) 141 157 { 142 158 if( strlen(key) > 0 && strlen(val) > 0 )
