mirror of
https://github.com/urbit/shrub.git
synced 2024-12-21 01:41:37 +03:00
vere: refactors macros for binary alias ($pier/.run)
This commit is contained in:
parent
63109bdbc8
commit
0aa09ba7cb
@ -147,12 +147,13 @@ static c3_c*
|
||||
_main_pier_run(c3_c* bin_c)
|
||||
{
|
||||
c3_c* dir_c = 0;
|
||||
c3_w len_w = strlen(bin_c);
|
||||
c3_w bin_w = strlen(bin_c);
|
||||
c3_w len_w = strlen(U3_BIN_ALIAS);
|
||||
|
||||
// no args, argv[0] == $pier/.run
|
||||
//
|
||||
if ( (U3_BIN_ALIAS_LEN <= len_w)
|
||||
&& (0 == strcmp(bin_c + (len_w - U3_BIN_ALIAS_LEN), U3_BIN_ALIAS)) )
|
||||
if ( (len_w <= bin_w)
|
||||
&& (0 == strcmp(bin_c + (bin_w - len_w), U3_BIN_ALIAS)) )
|
||||
{
|
||||
bin_c = strdup(bin_c); // dirname can modify
|
||||
dir_c = _main_repath(dirname(bin_c));
|
||||
|
@ -131,12 +131,14 @@
|
||||
/** Binary alias.
|
||||
**/
|
||||
# ifdef U3_OS_mingw
|
||||
# define U3_BIN_ALIAS ".run.exe"
|
||||
# define U3_BIN_SUFFIX ".exe"
|
||||
# else
|
||||
# define U3_BIN_ALIAS ".run"
|
||||
# define U3_BIN_SUFFIX ""
|
||||
# endif
|
||||
|
||||
# define U3_BIN_ALIAS_LEN (sizeof(U3_BIN_ALIAS) - 1)
|
||||
|
||||
|
||||
# define U3_BIN_ALIAS ".run" U3_BIN_SUFFIX
|
||||
|
||||
/** Address space layout.
|
||||
***
|
||||
|
Loading…
Reference in New Issue
Block a user