File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -95,23 +95,23 @@ int main(void)
95
95
push (sin (pop ()));
96
96
break ;
97
97
98
- case 'e ' :
98
+ case 'E ' :
99
99
push (exp (pop ()));
100
100
break ;
101
101
102
- case 'h ' :
102
+ case 'H ' :
103
103
view_head ();
104
104
break ;
105
105
106
- case 'd ' :
106
+ case 'D ' :
107
107
duplicate ();
108
108
break ;
109
109
110
- case 's ' :
110
+ case 'S ' :
111
111
swap ();
112
112
break ;
113
113
114
- case 'c ' :
114
+ case 'C ' :
115
115
clear ();
116
116
break ;
117
117
@@ -244,7 +244,7 @@ int getop(char s[])
244
244
245
245
s [1 ] = '\0' ;
246
246
247
- if (isalpha (c ))
247
+ if (isalpha (c ) && !( c >= 'A' && c <= 'Z' ) )
248
248
{
249
249
var = c ;
250
250
return VARGET ;
@@ -296,3 +296,7 @@ int getop(char s[])
296
296
297
297
return NUMBER ;
298
298
}
299
+ /* To prevent the variable checking in getop() from overlapping with the letter commands,
300
+ make sure you set the commands to capital letters and explicitly tell the getop() to only
301
+ check for variable-getting if the character is not capital
302
+ e.g insteat of "if (isalpha(c))" you add "if (isalpha(c) && !(c >= 'A' && c >= 'Z'))"*/
You can’t perform that action at this time.
0 commit comments