diff options
Diffstat (limited to 'source4/scripting/ejs/mprutil.c')
-rw-r--r-- | source4/scripting/ejs/mprutil.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source4/scripting/ejs/mprutil.c b/source4/scripting/ejs/mprutil.c index 6b5c02c48d..a9cf71b15d 100644 --- a/source4/scripting/ejs/mprutil.c +++ b/source4/scripting/ejs/mprutil.c @@ -115,6 +115,18 @@ struct MprVar mprList(const char *name, const char **list) } /* + construct a MprVar from a string, using NULL if needed +*/ +struct MprVar mprString(const char *s) +{ + struct MprVar var; + if (s == NULL) { + return mprCreatePtrVar(NULL, "NULL"); + } + return mprCreateStringVar(s, 1); +} + +/* construct a string MprVar from a lump of data */ struct MprVar mprData(const uint8_t *p, size_t length) |