Changeset 1214 for trunk/src/kash/eval.c
- Timestamp:
- Oct 7, 2007, 10:39:58 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/eval.c
r1207 r1214 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 36 #include <sys/cdefs.h> 37 #endif 35 #if 0 38 36 #ifndef lint 39 #if 040 37 static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95"; 41 38 #else 42 39 __RCSID("$NetBSD: eval.c,v 1.84 2005/06/23 23:05:29 christos Exp $"); 43 #endif44 40 #endif /* not lint */ 41 #endif 45 42 46 43 #include <stdlib.h> 47 #include <signal.h>48 44 #include <stdio.h> 49 #include <unistd.h>50 #include <sys/fcntl.h>51 #include <sys/times.h>52 #include <sys/param.h>53 45 #include <sys/types.h> 54 #include <sys/wait.h>55 46 #ifdef HAVE_SYSCTL_H 56 # include <sys/sysctl.h>57 #endif 58 #ifdef _ _sun__59 # include <iso/limits_iso.h>47 # include <sys/sysctl.h> 48 #endif 49 #ifdef _MSC_VER 50 # include "getopt.h" 60 51 #endif 61 52 … … 85 76 #include "main.h" 86 77 #ifndef SMALL 87 # include "myhistedit.h"78 # include "myhistedit.h" 88 79 #endif 89 80 #include "shinstance.h" … … 169 160 evalcmd(shinstance *psh, int argc, char **argv) 170 161 { 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 162 char *p; 163 char *concat; 164 char **ap; 165 166 if (argc > 1) { 167 p = argv[1]; 168 if (argc > 2) { 169 STARTSTACKSTR(psh, concat); 170 ap = argv + 2; 171 for (;;) { 172 while (*p) 173 STPUTC(psh, *p++, concat); 174 if ((p = *ap++) == NULL) 175 break; 176 STPUTC(psh, ' ', concat); 177 } 178 STPUTC(psh, '\0', concat); 179 p = grabstackstr(psh, concat); 180 } 181 evalstring(psh, p, EV_TESTED); 182 } 183 return psh->exitstatus; 193 184 } 194 185 … … 637 628 return sys_path; 638 629 #else 639 630 return def_path; 640 631 #endif 641 632 } … … 1236 1227 1237 1228 mins = ticks / tpm; 1229 #ifdef _MSC_VER 1230 { 1231 char tmp[64]; 1232 sprintf(tmp, "%.4f", (ticks - mins * tpm) * 60.0 / tpm); 1233 strlcpy(seconds, tmp, l); 1234 } 1235 #else 1238 1236 snprintf(seconds, l, "%.4f", (ticks - mins * tpm) * 60.0 / tpm ); 1237 #endif 1239 1238 1240 1239 if (seconds[0] == '6' && seconds[1] == '0') {
Note:
See TracChangeset
for help on using the changeset viewer.