summaryrefslogtreecommitdiff
path: root/wrapper/runcom.c
diff options
context:
space:
mode:
authorLuke Shumaker <luke@HP-dv6426us-u904>2009-10-24 02:23:22 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-06-26 00:30:16 -0600
commitbddd6fb07906e660260ef0fced05440ecac8d9e9 (patch)
tree882c913e0cb2e89537747b90f8c47a65d5cd15d0 /wrapper/runcom.c
parent1eddff249b2c7ce54544b840562e782501d47924 (diff)
switching to git
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);