IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14517


Ignore:
Timestamp:
Aug 15, 2007, 3:23:58 PM (19 years ago)
Author:
eugene
Message:

prevent WW_binary from swallowing strings that look like math expressions, but are not

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.shell/stack_math.c

    r7080 r14517  
    11561156  char line[512];
    11571157
     1158  /* only 'N' and 'E' are allowed for WW_binary operations. anything else is either a
     1159   syntax error or is a string which looks like a math expression. */
     1160
     1161  if ((op[0] != 'N') && (op[0] != 'E')) {
     1162    sprintf (line, "error: op %c not defined for string operations!", op[0]);
     1163    push_error (line);
     1164    return (FALSE);
     1165  }
     1166
    11581167  /* evaluate stack will only call WW_binary with one numerical value,
    11591168     and only in the case that the string did not parse to a number
    11601169     thus: string == number -> false */
     1170
    11611171  if (!strncasecmp (&V1[0].type, "S", 1)) {
    11621172    value = (op[0] == 'N');
Note: See TracChangeset for help on using the changeset viewer.