[Nagiosplug-checkins] SF.net SVN: nagiosplug: [1968] nagiosplug/trunk/lib
dermoth at users.sourceforge.net
dermoth at users.sourceforge.net
Mon Mar 31 07:31:14 CEST 2008
Revision: 1968
http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=1968&view=rev
Author: dermoth
Date: 2008-03-30 22:31:14 -0700 (Sun, 30 Mar 2008)
Log Message:
-----------
Fix for last commit - I accidentaly broke my local Makefile and tests weren't being re-compiled.
Modified Paths:
--------------
nagiosplug/trunk/lib/extra_opts.c
nagiosplug/trunk/lib/extra_opts.h
nagiosplug/trunk/lib/parse_ini.c
nagiosplug/trunk/lib/parse_ini.h
nagiosplug/trunk/lib/tests/test_ini.c
nagiosplug/trunk/lib/tests/test_opts.c
Modified: nagiosplug/trunk/lib/extra_opts.c
===================================================================
--- nagiosplug/trunk/lib/extra_opts.c 2008-03-30 14:02:13 UTC (rev 1967)
+++ nagiosplug/trunk/lib/extra_opts.c 2008-03-31 05:31:14 UTC (rev 1968)
@@ -26,10 +26,9 @@
*****************************************************************************/
#include "common.h"
+#include "utils_base.h"
+#include "parse_ini.h"
#include "extra_opts.h"
-#include "parse_ini.h"
-#include "utils_base.h"
-#include <ctype.h>
/* FIXME: copied from utils.h; we should move a bunch of libs! */
int
@@ -66,7 +65,7 @@
/* Delete the extra opts argument */
for(j=i;j<*argc;j++) argv[j]=argv[j+1];
i--;
- *argc--;
+ *argc-=1;
}else if(strcmp(argv[i], "--extra-opts")==0){
if(!is_option(argv[i+1])){
/* It is a argument with separate value */
@@ -82,7 +81,7 @@
/* Delete the extra opts argument */
for(j=i;j<*argc;j++) argv[j]=argv[j+1];
i--;
- *argc--;
+ *argc-=1;
}
}
@@ -102,7 +101,10 @@
while(ea1=ea1->next) ea_num++;
}else{
ea_tmp=extra_args;
- while(ea_tmp=ea_tmp->next) ea_num++;
+ while(ea_tmp->next) {
+ ea_tmp=ea_tmp->next;
+ ea_num++;
+ }
ea_tmp->next=ea1;
}
ea1=ea_tmp=NULL;
Modified: nagiosplug/trunk/lib/extra_opts.h
===================================================================
--- nagiosplug/trunk/lib/extra_opts.h 2008-03-30 14:02:13 UTC (rev 1967)
+++ nagiosplug/trunk/lib/extra_opts.h 2008-03-31 05:31:14 UTC (rev 1968)
@@ -17,3 +17,4 @@
char **np_extra_opts(int *argc, char **argv, const char *plugin_name);
#endif /* _EXTRA_OPTS_H_ */
+
Modified: nagiosplug/trunk/lib/parse_ini.c
===================================================================
--- nagiosplug/trunk/lib/parse_ini.c 2008-03-30 14:02:13 UTC (rev 1967)
+++ nagiosplug/trunk/lib/parse_ini.c 2008-03-31 05:31:14 UTC (rev 1968)
@@ -26,8 +26,8 @@
*****************************************************************************/
#include "common.h"
+#include "utils_base.h"
#include "parse_ini.h"
-#include "utils_base.h"
#include <ctype.h>
#include <sys/types.h>
Modified: nagiosplug/trunk/lib/parse_ini.h
===================================================================
--- nagiosplug/trunk/lib/parse_ini.h 2008-03-30 14:02:13 UTC (rev 1967)
+++ nagiosplug/trunk/lib/parse_ini.h 2008-03-31 05:31:14 UTC (rev 1968)
@@ -59,3 +59,4 @@
np_arg_list* np_get_defaults(const char *locator, const char *default_section);
#endif /* _PARSE_INI_H_ */
+
Modified: nagiosplug/trunk/lib/tests/test_ini.c
===================================================================
--- nagiosplug/trunk/lib/tests/test_ini.c 2008-03-30 14:02:13 UTC (rev 1967)
+++ nagiosplug/trunk/lib/tests/test_ini.c 2008-03-31 05:31:14 UTC (rev 1968)
@@ -18,8 +18,8 @@
*****************************************************************************/
#include "common.h"
+#include "utils_base.h"
#include "parse_ini.h"
-#include "utils_base.h"
#include "tap.h"
Modified: nagiosplug/trunk/lib/tests/test_opts.c
===================================================================
--- nagiosplug/trunk/lib/tests/test_opts.c 2008-03-30 14:02:13 UTC (rev 1967)
+++ nagiosplug/trunk/lib/tests/test_opts.c 2008-03-31 05:31:14 UTC (rev 1968)
@@ -18,8 +18,8 @@
*****************************************************************************/
#include "common.h"
+#include "utils_base.h"
#include "extra_opts.h"
-#include "utils_base.h"
#include "tap.h"
@@ -119,7 +119,7 @@
argv_known[2] = "--something else=oops";
argv_known[3] = "--this=that";
argv_known[4] = NULL;
- argv_test=np_extra_opts(argc_test, argv_test, "check_disk");
+ argv_test=np_extra_opts(&argc_test, argv_test, "check_disk");
ok(array_diff(argc_test, argv_test, 4, argv_known), "Only extra opts specified twice");
my_free(&argc_test,argv_test);
@@ -141,7 +141,7 @@
argv_known[5] = "--arg1=val1";
argv_known[6] = "--arg2";
argv_known[7] = NULL;
- argv_test=np_extra_opts(argc_test, argv_test, "check_disk");
+ argv_test=np_extra_opts(&argc_test, argv_test, "check_disk");
ok(array_diff(argc_test, argv_test, 7, argv_known), "twice extra opts using two sections");
my_free(&argc_test,argv_test);
@@ -162,7 +162,7 @@
argv_known[2] = "--arg3";
argv_known[3] = "val2";
argv_known[4] = NULL;
- argv_test=np_extra_opts(argc_test, argv_test, "check_missing");
+ argv_test=np_extra_opts(&argc_test, argv_test, "check_missing");
ok(array_diff(argc_test, argv_test, 4, argv_known), "Missing section 1");
my_free(&argc_test,argv_test);
@@ -181,7 +181,7 @@
argv_known[2] = "--arg3";
argv_known[3] = "val2";
argv_known[4] = NULL;
- argv_test=np_extra_opts(argc_test, argv_test, "check_missing");
+ argv_test=np_extra_opts(&argc_test, argv_test, "check_missing");
ok(array_diff(argc_test, argv_test, 4, argv_known), "Missing section 2");
my_free(&argc_test,argv_test);
@@ -199,7 +199,7 @@
argv_known[2] = "--arg3";
argv_known[3] = "val2";
argv_known[4] = NULL;
- argv_test=np_extra_opts(argc_test, argv_test, "check_missing");
+ argv_test=np_extra_opts(&argc_test, argv_test, "check_missing");
ok(array_diff(argc_test, argv_test, 4, argv_known), "Missing section 3");
my_free(&argc_test,argv_test);
@@ -219,7 +219,7 @@
argv_known[3] = "--arg3";
argv_known[4] = "val2";
argv_known[5] = NULL;
- argv_test=np_extra_opts(argc_test, argv_test, "check_disk");
+ argv_test=np_extra_opts(&argc_test, argv_test, "check_disk");
ok(array_diff(argc_test, argv_test, 5, argv_known), "Default section 1");
my_free(&argc_test,argv_test);
@@ -238,7 +238,7 @@
argv_known[3] = "--arg3";
argv_known[4] = "val2";
argv_known[5] = NULL;
- argv_test=np_extra_opts(argc_test, argv_test, "check_disk");
+ argv_test=np_extra_opts(&argc_test, argv_test, "check_disk");
ok(array_diff(argc_test, argv_test, 5, argv_known), "Default section 2");
my_free(&argc_test,argv_test);
@@ -257,7 +257,7 @@
argv_known[3] = "--arg3";
argv_known[4] = "val2";
argv_known[5] = NULL;
- argv_test=np_extra_opts(argc_test, argv_test, "check_disk");
+ argv_test=np_extra_opts(&argc_test, argv_test, "check_disk");
ok(array_diff(argc_test, argv_test, 5, argv_known), "Default section 3");
my_free(&argc_test,argv_test);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list