initial gvim-wrapper program

This commit is contained in:
Josh Holtrop 2012-02-21 09:35:28 -05:00
commit e7b6791a4c
2 changed files with 24 additions and 0 deletions

6
Makefile Normal file
View File

@ -0,0 +1,6 @@
TARGET := gvim-wrapper
CFLAGS := -mno-cygwin -std=gnu99
LDFLAGS := -mno-cygwin
all: $(TARGET)

18
gvim-wrapper.c Normal file
View File

@ -0,0 +1,18 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
const char **new_argv = malloc(sizeof(char *) * (argc + 2));
int i = 0;
new_argv[i++] = "gvim";
new_argv[i++] = "--remote-tab-silent";
for (int n = 1; n < argc; n++)
{
new_argv[i++] = argv[n];
}
new_argv[i++] = NULL;
execv("C:\\apps\\Vim\\vim73\\gvim.exe", new_argv);
return -1;
}