summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-10-13 12:17:45 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-10-13 12:17:45 -0700
commitbba82193be7225c078e007c99a1537b68ba68bb1 (patch)
tree7aefebdcf0650c02355478fd4dc84e53815fa428 /src
parentc5c35050fca8396968b64f5bffe070ed2b293c32 (diff)
parent6bbaacf5f0cc1880006a75084539d773eda662ff (diff)
downloadvyatta-cfg-bba82193be7225c078e007c99a1537b68ba68bb1.tar.gz
vyatta-cfg-bba82193be7225c078e007c99a1537b68ba68bb1.zip
Merge branch 'mendocino' of suva.vyatta.com:/git/vyatta-cfg into mendocino
Diffstat (limited to 'src')
-rw-r--r--src/cli_path_utils.c2
-rw-r--r--src/commit2.c15
-rw-r--r--src/cstore/cstore.cpp2
3 files changed, 13 insertions, 6 deletions
diff --git a/src/cli_path_utils.c b/src/cli_path_utils.c
index 4111568..2874aeb 100644
--- a/src/cli_path_utils.c
+++ b/src/cli_path_utils.c
@@ -472,7 +472,7 @@ char *clind_unescape(const char *name)
{
const char *cp;
char *rcp, *ret;
- char len;
+ unsigned long len;
for(cp=name, len=0;*cp;++cp, ++len)
if(*cp=='%')
diff --git a/src/commit2.c b/src/commit2.c
index 884d2fe..0eb75f0 100644
--- a/src/commit2.c
+++ b/src/commit2.c
@@ -133,12 +133,13 @@ main(int argc, char** argv)
boolean full_commit_check = FALSE;
boolean break_priority = FALSE;
boolean disable_hook = FALSE;
+ char *commit_comment = NULL;
/* this is needed before calling certain glib functions */
g_type_init();
//grab inputs
- while ((ch = getopt(argc, argv, "dpthsecoafbr")) != -1) {
+ while ((ch = getopt(argc, argv, "dpthsecoafbrC:")) != -1) {
switch (ch) {
case 'd':
g_debug = TRUE;
@@ -177,6 +178,9 @@ main(int argc, char** argv)
case 'r':
disable_hook = TRUE;
break;
+ case 'C':
+ commit_comment = strdup(optarg);
+ break;
default:
usage();
exit(0);
@@ -374,7 +378,10 @@ main(int argc, char** argv)
if (strcmp(dirp->d_name, ".") != 0 &&
strcmp(dirp->d_name, "..") != 0) {
char buf[MAX_LENGTH_DIR_PATH*sizeof(char)];
- sprintf(buf,"%s/%s",COMMIT_HOOK_DIR,dirp->d_name);
+ if (commit_comment == NULL) {
+ commit_comment="commit";
+ }
+ sprintf(buf,"%s/%s %s",COMMIT_HOOK_DIR,dirp->d_name, commit_comment);
syslog(LOG_DEBUG,"Starting commit hook: %s",buf);
if (system(buf) == -1) {
syslog(LOG_WARNING,"Error on call to hook: %s", buf);
@@ -583,7 +590,7 @@ process_func(GNode *node, gpointer data)
if (!status) { //EXECUTE_LIST RETURNS FALSE ON FAILURE....
syslog(LOG_ERR,"commit error for %s:[%s]\n",ActionNames[result->_action],d->_path);
if (g_display_error_node) {
- fprintf(out_stream,"%s:[%s]\n",ActionNames[result->_action],d->_path);
+ fprintf(out_stream,"%s@errloc:[%s]\n",ActionNames[result->_action],d->_path);
}
result->_err_code = 1;
if (g_debug) {
@@ -1397,7 +1404,7 @@ validate_func(GNode *node, gpointer data)
}
syslog(LOG_ERR,"commit error for %s:[%s]\n",ActionNames[result->_action],d->_path);
if (g_display_error_node) {
- fprintf(out_stream,"%s:[%s]\n",ActionNames[result->_action],d->_path);
+ fprintf(out_stream,"%s@errloc:[%s]\n",ActionNames[result->_action],d->_path);
}
result->_err_code = 1;
if (g_debug) {
diff --git a/src/cstore/cstore.cpp b/src/cstore/cstore.cpp
index 8afa3ee..11cdb30 100644
--- a/src/cstore/cstore.cpp
+++ b/src/cstore/cstore.cpp
@@ -600,7 +600,7 @@ Cstore::getCompletionEnv(const vector<string>& comps, string& env)
pair<string, string> hpair(comp_vals[i], "");
push_tmpl_path(hpair.first);
vtw_def cdef;
- if (tmpl_parse(cdef)) {
+ if (tmpl_parse(cdef) && cdef.def_node_help) {
hpair.second = cdef.def_node_help;
} else {
hpair.second = "<No help text available>";