summaryrefslogtreecommitdiff
path: root/wrapper/runcom.c
diff options
context:
space:
mode:
Diffstat (limited to 'wrapper/runcom.c')
-rw-r--r--wrapper/runcom.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/wrapper/runcom.c b/wrapper/runcom.c
index d1b1cf4..10e9919 100644
--- a/wrapper/runcom.c
+++ b/wrapper/runcom.c
@@ -1,6 +1,6 @@
-const char *name="rvs";
-const char *ver="0.8c";
-/* Copyright (C) 2009 Luke Shumaker
+/* wrapper/runcom.c -- main program loop
+ system depends: this file is truly system-independant
+ Copyright (C) 2009 Luke Shumaker
This file is part of rvs.
@@ -20,8 +20,8 @@ const char *ver="0.8c";
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-extern const char *libexecdir=LIBEXECDIR;
-const char *plugin_conf=PLUGIN_CONF;
+const char *name=NAME;
+const char *ver=VER;
#include "rvs.h"
#include "plugins.h"
@@ -35,9 +35,10 @@ main ( int argc, char *argv[] )
{
if (argc > 1) {
/*load*/
+ char *cwd=getcwd(NULL,0);
xchdir(libexecdir);
struct plugin *plugins;
- plugins=load_plugins(stdin, plugin_conf);
+ plugins=load_plugins(stdin);
struct plugin_command_list *list;
list=plugin_find_commands(plugins,argv[1]);
if (list==NULL)
@@ -47,7 +48,18 @@ main ( int argc, char *argv[] )
root=plugin_depend_list(list,plugins);
/*do*/
- plugin_run(root);
+ xchdir(cwd);
+ int nbytes=10;
+ char *args=xmalloc(nbytes);
+ args[0]='\0';
+ int i;
+ for (i=2; i<argc; i++) {
+ stradds(&nbytes, &args, "\"" );
+ stradds(&nbytes, &args, argv[i]);
+ stradds(&nbytes, &args, "\" ");
+ }
+
+ plugin_run(root,args);
/*free*/
plugin_free_list(list);