@@ -404,6 +404,8 @@ int premake_locate_executable(lua_State* L, const char* argv0)
404404 }
405405#endif
406406
407+ (void )buffer ;
408+
407409 /* As a fallback, search the PATH with argv[0] */
408410 if (!path )
409411 {
@@ -451,9 +453,9 @@ int premake_locate_executable(lua_State* L, const char* argv0)
451453 * specified file. If found, returns the discovered path to the script on
452454 * the top of the Lua stack.
453455 */
454- int premake_test_file (lua_State * L , const char * filename , int searchMask )
456+ int premake_locate_file (lua_State * L , const char * filename , int searchMask )
455457{
456- if (searchMask & TEST_LOCAL ) {
458+ if (searchMask & SEARCH_LOCAL ) {
457459 if (do_isfile (L , filename )) {
458460 lua_pushcfunction (L , path_getabsolute );
459461 lua_pushstring (L , filename );
@@ -462,17 +464,17 @@ int premake_test_file(lua_State* L, const char* filename, int searchMask)
462464 }
463465 }
464466
465- if (scripts_path && (searchMask & TEST_SCRIPTS )) {
467+ if (scripts_path && (searchMask & SEARCH_SCRIPTS )) {
466468 if (do_locate (L , filename , scripts_path )) return OKAY ;
467469 }
468470
469- if (searchMask & TEST_PATH ) {
471+ if (searchMask & SEARCH_PATH ) {
470472 const char * path = getenv ("PREMAKE_PATH" );
471473 if (path && do_locate (L , filename , path )) return OKAY ;
472474 }
473475
474476#if !defined(PREMAKE_NO_BUILTIN_SCRIPTS )
475- if ((searchMask & TEST_EMBEDDED ) != 0 ) {
477+ if ((searchMask & SEARCH_EMBEDDED ) != 0 ) {
476478 /* Try to locate a record matching the filename */
477479 if (premake_find_embedded_script (filename ) != NULL ) {
478480 lua_pushstring (L , "$/" );
@@ -614,18 +616,18 @@ static int run_premake_main(lua_State* L, const char* script)
614616 * argument allowed as an override. Debug builds will look at the
615617 * local file system first, then fall back to embedded. */
616618#if defined(NDEBUG )
617- int z = premake_test_file (L , script ,
618- TEST_SCRIPTS | TEST_EMBEDDED );
619+ int z = premake_locate_file (L , script ,
620+ SEARCH_SCRIPTS | SEARCH_EMBEDDED );
619621#else
620- int z = premake_test_file (L , script ,
621- TEST_LOCAL | TEST_SCRIPTS | TEST_PATH | TEST_EMBEDDED );
622+ int z = premake_locate_file (L , script ,
623+ SEARCH_LOCAL | SEARCH_SCRIPTS | SEARCH_PATH | SEARCH_EMBEDDED );
622624#endif
623625
624626 /* If no embedded script can be found, release builds will then
625627 * try to fall back to the local file system, just in case */
626628#if defined(NDEBUG )
627629 if (z != OKAY ) {
628- z = premake_test_file (L , script , TEST_LOCAL | TEST_PATH );
630+ z = premake_locate_file (L , script , SEARCH_LOCAL | SEARCH_PATH );
629631 }
630632#endif
631633
0 commit comments