Skip to content

Commit

Permalink
adjust command on windows to allow for spaces in solver path
Browse files Browse the repository at this point in the history
  • Loading branch information
svigerske committed May 4, 2022
1 parent 34124a7 commit 5385b8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/amplsolver/amplsolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ int runSolver(
#ifndef _WIN32
if( snprintf(command, sizeof(command), "\"%s\" \"%s\" -AMPL 2>&1", as->solver, as->filename) >= sizeof(command) )
#else
/* windows doesn't seem to like quotes around the executable name */
if( snprintf(command, sizeof(command), "%s \"%s\" -AMPL 2>&1", as->solver, as->filename) >= sizeof(command) )
/* windows accepts quotes around exe only if everything is quoted again */
if( snprintf(command, sizeof(command), "\"\"%s\" \"%s\" -AMPL 2>&1\"", as->solver, as->filename) >= sizeof(command) )
#endif
{
/* with GAMS' limit on GMS_SSSIZE for option values and scratch dirname, this shouldn't happen */
Expand Down

0 comments on commit 5385b8b

Please sign in to comment.