summaryrefslogtreecommitdiff
path: root/lib/execute.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/execute.c')
-rw-r--r--lib/execute.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/execute.c b/lib/execute.c
index 0662849..5e67b5b 100644
--- a/lib/execute.c
+++ b/lib/execute.c
@@ -236,7 +236,7 @@ void* dataGetValue(data* dat, void* key)
struct dat* d;
ASSERT_PTR(dat);
- if(d = _dataFind(dat, key))
+ if((d = _dataFind(dat, key)))
return d->value;
return NULL;
@@ -252,7 +252,7 @@ bool dataSetValue(data* dat, void* key, void* value)
if(!_dataAllocate(dat))
return false;
- if(d = _dataFind(dat, key))
+ if((d = _dataFind(dat, key)))
{
d->value = value;
}
@@ -374,7 +374,7 @@ struct vari* _variablesFind(variables* vars, const char* name)
}
/* If not found then look up in the Environment */
- if(val = getenv(name))
+ if((val = getenv(name)))
return _variablesNew(vars, name, val, strlen(val));
return NULL;
@@ -442,7 +442,7 @@ bool variablesClear(variables* vars, const char* name)
{
struct vari* v;
ASSERT_PTR(vars);
- if(v = _variablesFind(vars, name))
+ if((v = _variablesFind(vars, name)))
starclr(v->value);
return true;
@@ -485,7 +485,7 @@ static char* _escapeString(const char* string)
while((pos += strcspn(string + pos, kSpecialChars)) < len)
cnt++, pos++;
- if(buff = (char*)malloc(sizeof(char) * (len + cnt + 1)))
+ if((buff = (char*)malloc(sizeof(char) * (len + cnt + 1))))
{
pos = 0;
strcpy(buff, string);
@@ -502,7 +502,6 @@ static char* _escapeString(const char* string)
int variablesSubstitute(variables* vars, r_stream* stream, r_script* script,
char** pstr, bool mode)
{
- size_t len = strlen(*pstr);
char* next = *pstr;
struct internal_state* state = stream->state;
@@ -584,7 +583,7 @@ int variablesSubstitute(variables* vars, r_stream* stream, r_script* script,
next[len] = 0;
/* Do we have this variable? */
- if(v = _variablesFind(vars, next + 1))
+ if((v = _variablesFind(vars, next + 1)))
value = v->value;
else
value = "\0\0";
@@ -638,7 +637,7 @@ int variablesSubstitute(variables* vars, r_stream* stream, r_script* script,
next = strrep(next, 0, starnext(value) ? "|" : "");
}
- while(value = starnext(value));
+ while((value = starnext(value)));
/* Add closing parentheses if needed */
next = strrep(next, 0, multi ? ")" : "");
@@ -683,7 +682,7 @@ bool variablesHasVars(const char* string)
{
const char* cur = string;
- if(cur = strchr(cur, '%'))
+ if((cur = strchr(cur, '%')))
{
if(!isEscaped(string, cur))
return true;
@@ -1109,7 +1108,6 @@ int vmExecute(r_stream* stream, r_script* script)
/* These are the registers passed to PCRE */
int pcreregs[MAX_REGS * 3];
- int num_regs = 0;
/* And over here we have the stack */
uint* vmStack = NULL;
@@ -1268,7 +1266,7 @@ int vmExecute(r_stream* stream, r_script* script)
* - We use the op header pointer as key to the pcre struct
* - And the pcre struct pointer as the key to the pcre_extra struct
*/
- if(re = (pcre*)dataGetValue(&(state->working), header))
+ if((re = (pcre*)dataGetValue(&(state->working), header)))
{
/* This prevents the freeing of stuff below */
cache = true;