IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 22, 2004, 1:23:23 PM (22 years ago)
Author:
eugene
Message:

fixing dvomath for strings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.basic/run_if.c

    r2598 r2792  
    3030  /* determine value of conditional expression */
    3131  val = dvomath (1, &argv[1], &size, 0);
    32   if (val == NULL) { /* try expression as string op string */
    33     char **stack;
    34     int Nstack;
     32  if (val == NULL) return (FALSE);
     33  logic = atof (val); /* warning: round-off error is a danger */
    3534
    36     stack = isolate_elements (1, &argv[1], &Nstack);
    37     if (Nstack != 5) goto syntax;
    38     if (strcmp (stack[0], "(")) goto syntax;
    39     if (strcmp (stack[4], ")")) goto syntax;
    40     equals = -1;
    41     if (!strcmp (stack[2], "==")) equals = TRUE;
    42     if (!strcmp (stack[2], "!=")) equals = TRUE;
    43     if (equals == -1) goto syntax;
    44     logic = FALSE;
    45     if (equals && !strcmp (stack[1], stack[3])) logic = TRUE;
    46     if (!equals && strcmp (stack[1], stack[3])) logic = TRUE;
    47   } else {
    48     logic = atof (val); /* warning: round-off error is a danger */
    49   }
    5035  if (BreakOnTrue) {
    5136    if (logic) {
Note: See TracChangeset for help on using the changeset viewer.