aboutsummaryrefslogtreecommitdiff
path: root/desiredata
diff options
context:
space:
mode:
authorN.N. <matju@users.sourceforge.net>2009-04-26 03:57:57 +0000
committerN.N. <matju@users.sourceforge.net>2009-04-26 03:57:57 +0000
commit696e04ba7d19fa1d370a8f4a6fc71f49345c3553 (patch)
tree4be2731d9e881d29f3c78bc1384597c1d8de8e83 /desiredata
parent4116b1ebe8822c2ebd5393ba1fbb461b6b1084d3 (diff)
refrain from using std::vector's data() for portability reasons (it's GNU-only)
svn path=/trunk/; revision=11152
Diffstat (limited to 'desiredata')
-rw-r--r--desiredata/src/s_path.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/desiredata/src/s_path.c b/desiredata/src/s_path.c
index 56c90c35..34925739 100644
--- a/desiredata/src/s_path.c
+++ b/desiredata/src/s_path.c
@@ -250,6 +250,15 @@ extern "C" int sys_argparse(int argc, char **argv);
#define NUMARGS 1000
#define foreach(ITER,COLL) for(typeof(COLL.begin()) ITER = COLL.begin(); ITER != (COLL).end(); ITER++)
+static int sys_argparse(std::vector<char *> args) {
+ size_t argc = args.size();
+ char **argv = (char **)malloc(argc*sizeof(char *));
+ for (size_t i=0; i<argc; i++) argv[i] = args[i];
+ int r = sys_argparse(argc,argv);
+ free(argv);
+ return r;
+}
+
extern "C" int sys_parsercfile(char *filename) {
std::vector<char*> argv;
char buf[1000];
@@ -279,7 +288,8 @@ extern "C" int sys_parsercfile(char *filename) {
foreach(a,argv) post("%s",*a);
} else post("no RC file arguments found");
}
- if (sys_argparse(argv.size(),argv.data())) {
+// if (sys_argparse(argv.size(),argv.data())) {
+ if (sys_argparse(argv)) {
post("error parsing RC arguments");
goto cleanup;
}