cli_dbxml(): Fix handling of mountpoints

The function has code to handle mountpoints, however there is
a logic error that prevents that code from ever being run.

Fix that.
This commit is contained in:
Colin Baumgarten 2024-03-18 13:15:14 +01:00 committed by Olof Hagsand
parent fcdfbd23cc
commit 2142a4fd96

View file

@ -425,14 +425,11 @@ cli_dbxml(clixon_handle h,
if (cvec_concat_cb(argv, api_path_fmt_cb) < 0) if (cvec_concat_cb(argv, api_path_fmt_cb) < 0)
goto done; goto done;
api_path_fmt = cbuf_get(api_path_fmt_cb); api_path_fmt = cbuf_get(api_path_fmt_cb);
argc = cvec_len(argv); if (cvec_len(argv) > 0){
if (cvec_len(argv) > argc){ argc = cvec_len(argv) - 1;
cv = cvec_i(argv, argc++); cv = cvec_i(argv, argc++);
str = cv_string_get(cv); str = cv_string_get(cv);
if (strncmp(str, "mtpoint:", strlen("mtpoint:")) != 0){ if (str && strncmp(str, "mtpoint:", strlen("mtpoint:")) == 0)
clixon_err(OE_PLUGIN, 0, "mtpoint does not begin with 'mtpoint:'");
goto done;
}
mtpoint = str + strlen("mtpoint:"); mtpoint = str + strlen("mtpoint:");
} }
/* Remove all keywords */ /* Remove all keywords */