Changeset 40487
- Timestamp:
- Jun 27, 2018, 3:58:36 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/lib.shell/evaluate_stack.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/lib.shell/evaluate_stack.c
r40315 r40487 208 208 push_error (line); 209 209 210 // we need to verify that .name exists for both 211 if ((stack[i-1].name && strchr(stack[i-1].name, ':')) || (stack[i-2].name && strchr(stack[i-2].name, ':'))) { 210 int isTrinary = TRUE; 211 isTrinary = isTrinary && (i >= 2); 212 // isTrinary = isTrinary && (stack[i - 1] != NULL); 213 // isTrinary = isTrinary && (stack[i - 2] != NULL); 214 isTrinary = isTrinary && (stack[i - 1].name != NULL); 215 isTrinary = isTrinary && (stack[i - 2].name != NULL); 216 isTrinary = isTrinary && (strchr(stack[i-1].name, ':') || strchr(stack[i-2].name, ':')); 217 if (isTrinary) { 212 218 snprintf (line, 512, "syntax error: invalid operand for binary operation: %s or %s\n(Note that the : in a trinary operation must be protected by spaces)\n", stack[i-1].name, stack[i-2].name); 213 219 push_error (line); 214 220 } 221 215 222 clear_stack (&tmp_stack); 216 223 return (FALSE);
Note:
See TracChangeset
for help on using the changeset viewer.
