mirror of
https://github.com/urbit/shrub.git
synced 2024-12-21 09:51:36 +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)
|
_main_pier_run(c3_c* bin_c)
|
||||||
{
|
{
|
||||||
c3_c* dir_c = 0;
|
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
|
// no args, argv[0] == $pier/.run
|
||||||
//
|
//
|
||||||
if ( (U3_BIN_ALIAS_LEN <= len_w)
|
if ( (len_w <= bin_w)
|
||||||
&& (0 == strcmp(bin_c + (len_w - U3_BIN_ALIAS_LEN), U3_BIN_ALIAS)) )
|
&& (0 == strcmp(bin_c + (bin_w - len_w), U3_BIN_ALIAS)) )
|
||||||
{
|
{
|
||||||
bin_c = strdup(bin_c); // dirname can modify
|
bin_c = strdup(bin_c); // dirname can modify
|
||||||
dir_c = _main_repath(dirname(bin_c));
|
dir_c = _main_repath(dirname(bin_c));
|
||||||
|
@ -131,12 +131,14 @@
|
|||||||
/** Binary alias.
|
/** Binary alias.
|
||||||
**/
|
**/
|
||||||
# ifdef U3_OS_mingw
|
# ifdef U3_OS_mingw
|
||||||
# define U3_BIN_ALIAS ".run.exe"
|
# define U3_BIN_SUFFIX ".exe"
|
||||||
# else
|
# else
|
||||||
# define U3_BIN_ALIAS ".run"
|
# define U3_BIN_SUFFIX ""
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# define U3_BIN_ALIAS_LEN (sizeof(U3_BIN_ALIAS) - 1)
|
|
||||||
|
|
||||||
|
# define U3_BIN_ALIAS ".run" U3_BIN_SUFFIX
|
||||||
|
|
||||||
/** Address space layout.
|
/** Address space layout.
|
||||||
***
|
***
|
||||||
|
Loading…
Reference in New Issue
Block a user