Skip to content

Commit 395da13

Browse files
committed
onebinary: rewrite program_invocation_short_name
this is not very portable
1 parent cbaee6a commit 395da13

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/onebinary_gen.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
# '#include "src/controller/controller.cpp"',
112112
'int main(int argc, char *argv[]){',
113113
' if (argc < 2) {',
114+
' program_invocation_short_name = (char *)"MistController";'
114115
' return ControllerMain(argc, argv);',
115116
' }',
116117
' // Create a new argv array without argv[1]',
@@ -129,6 +130,7 @@
129130
for cap in capabilities:
130131
entrypoint_lines.extend([
131132
' else if (strcmp(argv[1], "' + cap['binary_name'] + '") == 0) {',
133+
' program_invocation_short_name = argv[1];'
132134
' return ' + cap['func_name'] +'<' + cap['class_name'] + '>(new_argc, new_argv);',
133135
' }',
134136
])
@@ -138,6 +140,7 @@
138140
' return SessionMain(new_argc, new_argv);',
139141
' }',
140142
' else {',
143+
' program_invocation_short_name = (char *)"MistController";',
141144
' return ControllerMain(argc, argv);',
142145
' }',
143146
' INFO_MSG("binary not found: %s", argv[1]);',

0 commit comments

Comments
 (0)