#include <c-ctype.h>
#include <signal.h>
-#include <assert.h>
#include "system.h"
#include "die.h"
#include "error.h"
case 'r': return '\r';
case 't': return '\t';
case 'v': return '\v';
- default: assert (0); /* LCOV_EXCL_LINE */
+ default: assume (false);
}
}
static const char* _GL_ATTRIBUTE_PURE
scan_varname (const char* str)
{
- assert (str && *str == '$'); /* LCOV_EXCL_LINE */
if ( *(str+1) == '{' && (c_isalpha (*(str+2)) || *(str+2) == '_'))
{
const char* end = str+3;
size_t buflen;
int cnt = 1;
- assert (str && str[0] && !c_isspace (str[0])); /* LCOV_EXCL_LINE */
-
dq = sq = sp = false;
buflen = strlen (str)+1;
switch (*str)
{
case '\'':
- assert (!(sq && dq)); /* LCOV_EXCL_LINE */
sq = !sq && !dq;
break;
case '"':
- assert (!(sq && dq)); /* LCOV_EXCL_LINE */
dq = !sq && !dq;
break;
} \
} while (0)
- assert (str && str[0] && !c_isspace (str[0])); /* LCOV_EXCL_LINE */
-
validate_split_str (str, &buflen, &newargc);
/* allocate buffer. +6 for the "DUMMY\0" executable name, +1 for NUL. */
/* Store the ${VARNAME} value. */
{
char *n = extract_varname (str);
- assert (n); /* ${VARNAME} already validated. */
char *v = getenv (n);
if (v)
{