File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -95,23 +95,23 @@ int main(void)
9595 push (sin (pop ()));
9696 break ;
9797
98- case 'e ' :
98+ case 'E ' :
9999 push (exp (pop ()));
100100 break ;
101101
102- case 'h ' :
102+ case 'H ' :
103103 view_head ();
104104 break ;
105105
106- case 'd ' :
106+ case 'D ' :
107107 duplicate ();
108108 break ;
109109
110- case 's ' :
110+ case 'S ' :
111111 swap ();
112112 break ;
113113
114- case 'c ' :
114+ case 'C ' :
115115 clear ();
116116 break ;
117117
@@ -244,7 +244,7 @@ int getop(char s[])
244244
245245 s [1 ] = '\0' ;
246246
247- if (isalpha (c ))
247+ if (isalpha (c ) && !( c >= 'A' && c <= 'Z' ) )
248248 {
249249 var = c ;
250250 return VARGET ;
@@ -296,3 +296,7 @@ int getop(char s[])
296296
297297 return NUMBER ;
298298}
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