Convert test-launcher into a generic asan-launcher so that it can be used to run kitty as well

This commit is contained in:
Kovid Goyal
2017-11-01 12:03:59 +05:30
parent 96f85b187e
commit 04a61d0e21
5 changed files with 28 additions and 23 deletions

17
asan-launcher.c Normal file
View File

@@ -0,0 +1,17 @@
/*
* linux-launcher.c
* Copyright (C) 2017 Kovid Goyal <kovid at kovidgoyal.net>
*
* Distributed under terms of the GPL3 license.
*/
#include <Python.h>
#define MAX_ARGC 1024
int main(int argc, char *argv[]) {
wchar_t *argvw[MAX_ARGC + 1] = {0};
argvw[0] = L"kitty";
for (int i = 1; i < argc; i++) argvw[i] = Py_DecodeLocale(argv[i], NULL);
return Py_Main(argc, argvw);
}