Skip to content

Commit dfaffeb

Browse files
committed
Merge branch '3896-fix-issue-reading-solution-files' into 'master'
Resolve "Issue reading solution files" Closes #3896 See merge request integer/scip!3807
2 parents 5af0c03 + bcbea21 commit dfaffeb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/scip/scip_sol.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -3263,16 +3263,16 @@ SCIP_RETCODE readSolFile(
32633263
lineno++;
32643264

32653265
/* there are some lines which may precede the solution information */
3266-
if( SCIPstrncasecmp(buffer, "solution status:", 16) == 0 || SCIPstrncasecmp(buffer, "objective value:", 16) == 0 ||
3267-
SCIPstrncasecmp(buffer, "Log started", 11) == 0 || SCIPstrncasecmp(buffer, "Variable Name", 13) == 0 ||
3268-
SCIPstrncasecmp(buffer, "All other variables", 19) == 0 || strspn(buffer, " \n\r\t\f") == strlen(buffer) ||
3269-
SCIPstrncasecmp(buffer, "NAME", 4) == 0 || SCIPstrncasecmp(buffer, "ENDATA", 6) == 0 || /* allow parsing of SOL-format on the MIPLIB 2003 pages */
3270-
SCIPstrncasecmp(buffer, "=obj=", 5) == 0 ) /* avoid "unknown variable" warning when reading MIPLIB SOL files */
3266+
if( SCIPstrncasecmp(buffer, "solution status:", 16) == 0 || SCIPstrncasecmp(buffer, "objective value:", 16) == 0
3267+
|| buffer[strspn(buffer, " \t\n\v\f\r")] == '\0' || SCIPstrncasecmp(buffer, "Log started", 11) == 0
3268+
|| SCIPstrncasecmp(buffer, "Variable Name", 13) == 0 || SCIPstrncasecmp(buffer, "All other variables", 19) == 0
3269+
|| SCIPstrncasecmp(buffer, "NAME", 4) == 0 || SCIPstrncasecmp(buffer, "ENDATA", 6) == 0 /* allow parsing of SOL-format on the MIPLIB 2003 pages */
3270+
|| SCIPstrncasecmp(buffer, "=obj=", 5) == 0 ) /* avoid "unknown variable" warning when reading MIPLIB SOL files */
32713271
continue;
32723272

32733273
/* tokenize the line */
3274-
varname = SCIPstrtok(buffer, " \t", &endptr);
3275-
valuestring = SCIPstrtok(NULL, " \t", &endptr);
3274+
varname = SCIPstrtok(buffer, " \t\v", &endptr);
3275+
valuestring = SCIPstrtok(NULL, " \t\n\v\f\r", &endptr);
32763276
if( valuestring == NULL )
32773277
{
32783278
SCIPerrorMessage("Invalid input line %d in solution file <%s>: <%s>.\n", lineno, filename, buffer);

0 commit comments

Comments
 (0)