Changeset 1214 for trunk/src/kash/eval.c


Ignore:
Timestamp:
Oct 7, 2007, 10:39:58 PM (18 years ago)
Author:
bird
Message:

some more cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/eval.c

    r1207 r1214  
    3333 */
    3434
    35 #ifdef HAVE_SYS_CDEFS_H
    36 #include <sys/cdefs.h>
    37 #endif
     35#if 0
    3836#ifndef lint
    39 #if 0
    4037static char sccsid[] = "@(#)eval.c      8.9 (Berkeley) 6/8/95";
    4138#else
    4239__RCSID("$NetBSD: eval.c,v 1.84 2005/06/23 23:05:29 christos Exp $");
    43 #endif
    4440#endif /* not lint */
     41#endif
    4542
    4643#include <stdlib.h>
    47 #include <signal.h>
    4844#include <stdio.h>
    49 #include <unistd.h>
    50 #include <sys/fcntl.h>
    51 #include <sys/times.h>
    52 #include <sys/param.h>
    5345#include <sys/types.h>
    54 #include <sys/wait.h>
    5546#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"
    6051#endif
    6152
     
    8576#include "main.h"
    8677#ifndef SMALL
    87 #include "myhistedit.h"
     78# include "myhistedit.h"
    8879#endif
    8980#include "shinstance.h"
     
    169160evalcmd(shinstance *psh, int argc, char **argv)
    170161{
    171         char *p;
    172         char *concat;
    173         char **ap;
    174 
    175         if (argc > 1) {
    176                 p = argv[1];
    177                 if (argc > 2) {
    178                         STARTSTACKSTR(psh, concat);
    179                         ap = argv + 2;
    180                         for (;;) {
    181                                 while (*p)
    182                                         STPUTC(psh, *p++, concat);
    183                                 if ((p = *ap++) == NULL)
    184                                         break;
    185                                 STPUTC(psh, ' ', concat);
    186                         }
    187                         STPUTC(psh, '\0', concat);
    188                         p = grabstackstr(psh, concat);
    189                 }
    190                 evalstring(psh, p, EV_TESTED);
    191         }
    192         return psh->exitstatus;
     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;
    193184}
    194185
     
    637628        return sys_path;
    638629#else
    639     return def_path;
     630        return def_path;
    640631#endif
    641632}
     
    12361227
    12371228        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
    12381236        snprintf(seconds, l, "%.4f", (ticks - mins * tpm) * 60.0 / tpm );
     1237#endif
    12391238
    12401239        if (seconds[0] == '6' && seconds[1] == '0') {
Note: See TracChangeset for help on using the changeset viewer.