* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/* Partially synced with Wine Staging 1.7.37 */
+/* Partially synced with Wine Staging 2.2 */
#include "setupapi_private.h"
int cur_section; /* index of section being parsed*/
struct line *line; /* current line */
unsigned int line_pos; /* current line position in file */
+ unsigned int broken_line; /* first line containing invalid data (if any) */
unsigned int error; /* error code */
unsigned int token_len; /* current token len */
WCHAR token[MAX_FIELD_LEN+1]; /* current token */
set_state( parser, SECTION_NAME );
return p + 1;
default:
- if (!isspaceW(*p))
+ if (isspaceW(*p)) break;
+ if (parser->cur_section != -1)
{
parser->start = p;
set_state( parser, KEY_NAME );
return p;
}
+ if (!parser->broken_line)
+ parser->broken_line = parser->line_pos;
break;
}
}
parser.stack_pos = 0;
parser.cur_section = -1;
parser.line_pos = 1;
+ parser.broken_line = 0;
parser.error = 0;
parser.token_len = 0;
/* find the [strings] section */
file->strings_section = find_section( file, Strings );
+
+ if (file->strings_section == -1 && parser.broken_line)
+ {
+ if (error_line) *error_line = parser.broken_line;
+ return ERROR_EXPECTED_SECTION_NAME;
+ }
+
return 0;
}