summaryrefslogtreecommitdiff
path: root/src/commit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/commit.c')
-rw-r--r--src/commit.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/commit.c b/src/commit.c
index 400328e..c3219e5 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -157,6 +157,7 @@ static boolean validate_dir_for_commit()
cp = NULL;
status = get_value(&cp, &m_path);
if (status == VTWERR_OK) {
+ size_t value_size = 0;
#ifdef DEBUG1
printf("Validating value |%s|\n"
"for path %s\n", cp, m_path.path);
@@ -167,6 +168,7 @@ static boolean validate_dir_for_commit()
// Bug #2509
if (def.multi) {
char *old_value = NULL;
+ value_size = strlen(cp);
switch_path(APATH); // temporarily switching to the active config path
status = get_value(&old_value, &m_path);
if (status == VTWERR_OK) {
@@ -176,8 +178,10 @@ static boolean validate_dir_for_commit()
if (old_value)
my_free(old_value);
}
-
- status = validate_value(&def, cp);
+ if (strlen(cp) > 0 || value_size == 0)
+ status = validate_value(&def, cp);
+ else
+ status = TRUE;
ret = ret && status;
}
if (cp)
@@ -238,7 +242,7 @@ static boolean validate_dir_for_commit()
if (!def_present || !def.tag)
pop_path(&t_path); /* for PUSH 2b */
- }
+ } // while
status = closedir(dp);
if (status)
bye("Cannot close dir %s\n", m_path.path);
@@ -1334,8 +1338,8 @@ static int fin_commit(boolean ok)
static char format4[]="rm -rf %s/{.*,*} >&/dev/null ; /bin/true"; /*cdirp*/
static char format5[]="rm -rf %s/{.*,*} >&/dev/null ; /bin/true"; /*adirp*/
static char format6[]="mv -f %s/* -t %s";/*tmpp, adirp*/
- static char format7[]="sudo mount -t unionfs -o dirs=%s=rw:%s=ro"
- " unionfs %s"; /*cdirp, adirp, mdirp*/
+ static char format7[]="sudo mount -t $UNIONFS -o dirs=%s=rw:%s=ro"
+ " $UNIONFS %s"; /*cdirp, adirp, mdirp*/
int m_len = strlen(get_mdirp());
int t_len = strlen(get_tmpp());
int c_len = strlen(get_cdirp());