Patch by Paul Whittaker, make busybox dc compatable with GNU dc.
authorGlenn L McGrath <bug1@ihug.co.nz>
Sat, 24 Jul 2004 06:01:52 +0000 (06:01 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Sat, 24 Jul 2004 06:01:52 +0000 (06:01 -0000)
the following example was broken, echo "1 1 +" | dc

miscutils/dc.c

index 0ac658d9c31d76312de367cf15e641fdabdb4276..112f6df3ff866ccc3d1834b1810c0cb957f2dd00 100644 (file)
@@ -114,11 +114,6 @@ static void print_no_pop(void)
        print_base(stack[pointer-1]);
 }
 
-static void print(void)
-{
-       print_base(pop());
-}
-
 struct op {
        const char *name;
        void (*function) (void);
@@ -155,10 +150,8 @@ static void stack_machine(const char *argument)
        double d;
        const struct op *o = operators;
 
-       if (argument == 0) {
-               print();
+       if (argument == 0)
                return;
-       }
 
        d = strtod(argument, &endPointer);