@@ -110,10 +110,10 @@ char *shell(const char *cmd) {
110110 return result ;
111111}
112112
113- int dev_run (const char * src , var_t * r , int wait ) {
113+ int dev_run (const char * cmd , var_t * r , int wait ) {
114114 int result = 1 ;
115115 if (r != NULL ) {
116- char * buf = shell (src );
116+ char * buf = shell (cmd );
117117 if (buf != NULL ) {
118118 r -> type = V_STR ;
119119 r -> v .p .ptr = buf ;
@@ -137,13 +137,13 @@ int dev_run(const char *src, var_t *r, int wait) {
137137 }
138138 } else {
139139 HWND hwnd = GetActiveWindow ();
140- ShellExecute (hwnd , "open" , src , 0 , 0 , SW_SHOWNORMAL );
140+ ShellExecute (hwnd , "open" , cmd , 0 , 0 , SW_SHOWNORMAL );
141141 }
142142 return result ;
143143}
144144
145145#else
146- int dev_run (const char * src , var_t * r , int wait ) {
146+ int dev_run (const char * cmd , var_t * r , int wait ) {
147147 int result = 1 ;
148148 if (r != NULL ) {
149149 r -> type = V_STR ;
@@ -154,7 +154,7 @@ int dev_run(const char *src, var_t *r, int wait) {
154154 int bytes = 0 ;
155155 int total = 0 ;
156156 char buf [BUFSIZE + 1 ];
157- FILE * fin = popen (src , "r" );
157+ FILE * fin = popen (cmd , "r" );
158158 if (fin ) {
159159 while (!feof (fin )) {
160160 bytes = fread (buf , 1 , BUFSIZE , fin );
@@ -172,18 +172,18 @@ int dev_run(const char *src, var_t *r, int wait) {
172172 result = 0 ;
173173 }
174174 } else if (wait ) {
175- result = (system (src ) != -1 );
175+ result = (system (cmd ) != -1 );
176176 }
177177 else if (fork () == 0 ) {
178178 // exec separate process
179- int size = strlen (src ) + 3 ;
179+ int size = strlen (cmd ) + 3 ;
180180 char * src1 = malloc (size );
181181 if (src1 != NULL ) {
182182 memset (src1 , '\0' , size );
183183 // double quote the command
184184 * src1 = '"' ;
185- strcat (src1 , src );
186- * (src1 + strlen (src ) + 1 ) = '"' ;
185+ strcat (src1 , cmd );
186+ * (src1 + strlen (cmd ) + 1 ) = '"' ;
187187 // -c means the next argument is the command string to execute
188188 // this allow us to execute shell script
189189 execlp ("sh" , "sh" , "-c" , src1 , NULL );
0 commit comments