Changeset 375 for trunk/src/gmake


Ignore:
Timestamp:
Dec 18, 2005, 5:54:17 AM (20 years ago)
Author:
bird
Message:

Re-initialize globals.

Location:
trunk/src/gmake/kmkbuiltin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gmake/kmkbuiltin/cp.c

    r371 r375  
    7878#include "mscfakes.h"
    7979#include "ftsfake.h"
    80 #endif 
     80#endif
    8181
    8282#include "cp_extern.h"
     
    136136        fflag = iflag = nflag = pflag = vflag = Rflag = rflag = 0;
    137137        info = 0;
     138
    138139        /* reset getopt and set progname. */
    139140        g_progname = argv[0];
     
    146147#else
    147148        optind = 0; /* init */
    148 #endif 
     149#endif
    149150
    150151        Hflag = Lflag = Pflag = 0;
     
    169170#else
    170171                        return errx(1, "recursive copy is not implemented!");
    171 #endif 
     172#endif
    172173                case 'f':
    173174                        fflag = 1;
     
    191192#else
    192193                        return errx(1, "recursive copy is not implemented!");
    193 #endif 
     194#endif
    194195                case 'v':
    195196                        vflag = 1;
     
    215216                fts_options &= ~FTS_PHYSICAL;
    216217                fts_options |= FTS_LOGICAL;
    217 #endif 
     218#endif
    218219        }
    219220#ifdef DO_CP_TREE
     
    225226                        fts_options |= FTS_LOGICAL;
    226227                }
    227         } else 
    228 #endif 
     228        } else
     229#endif
    229230        {
    230231                fts_options &= ~FTS_PHYSICAL;
  • trunk/src/gmake/kmkbuiltin/install.c

    r374 r375  
    141141        const char *group, *owner, *to_name;
    142142
     143        /* reinitialize globals */
     144        mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
     145        suffix = BACKUP_SUFFIX;
     146        gid = 0;
     147        uid = 0;
     148        dobackup = docompare = dodir = dopreserve = dostrip = nommap = safecopy = verbose = 0;
     149
     150        /* reset getopt and set progname. */
     151        g_progname = argv[0];
     152        opterr = 1;
     153        optarg = NULL;
     154        optopt = 0;
     155#if defined(__FreeBSD__) || defined(__EMX__)
     156        optreset = 1;
     157        optind = 1;
     158#else
     159        optind = 0; /* init */
     160#endif
     161
    143162        iflags = 0;
    144163        group = owner = NULL;
  • trunk/src/gmake/kmkbuiltin/ln.c

    r370 r375  
    4444#ifndef _MSC_VER
    4545#include <sys/param.h>
    46 #endif 
     46#endif
    4747#include <sys/stat.h>
    4848
     
    5757#else
    5858#include "mscfakes.h"
    59 #endif 
     59#endif
    6060
    6161static int      fflag;                          /* Unlink existing files. */
     
    7878        char *p, *sourcedir;
    7979        int ch, exitval;
     80
     81        /* initialize globals. */
     82        fflag = hflag = iflag = sflag = vflag = 0;
     83        linkch = 0;
     84        linkf = NULL;
    8085
    8186        /* kmk: reset getopt() and set program name. */
     
    8994#else
    9095        optind = 0; /* init */
    91 #endif 
     96#endif
    9297
    9398#if 0 /* kmk: we don't need this. */
     
    114119        (void)p;
    115120#endif
    116        
     121
    117122
    118123        while ((ch = getopt(argc, argv, "fhinsv")) != -1)
  • trunk/src/gmake/kmkbuiltin/mkdir.c

    r370 r375  
    4949#ifndef _MSC_VER
    5050#include <libgen.h>
    51 #endif 
     51#endif
    5252#include <stdio.h>
    5353#include <stdlib.h>
     
    5858#else
    5959#include "mscfakes.h"
    60 #endif 
     60#endif
    6161
    6262extern void * setmode(const char *p);
     
    7777        omode = pflag = 0;
    7878        mode = NULL;
     79
     80        /* reinitialize globals */
    7981        vflag = 0;
     82
    8083        /* kmk: reset getopt and set progname */
    8184        g_progname = argv[0];
     
    8891#else
    8992        optind = 0; /* init */
    90 #endif 
     93#endif
    9194        while ((ch = getopt(argc, argv, "m:pv")) != -1)
    9295                switch(ch) {
     
    176179                p = p2 + 1;
    177180        }
    178 #endif 
     181#endif
    179182        if (p[0] == '/')                /* Skip leading '/'. */
    180183                ++p;
  • trunk/src/gmake/kmkbuiltin/rm.c

    r370 r375  
    4646#include <sys/param.h>
    4747#include <sys/mount.h>
    48 #endif 
     48#endif
    4949
    5050#include "err.h"
     
    5353#ifdef DO_RMTREE
    5454#include <fts.h>
    55 #endif 
     55#endif
    5656#ifndef _MSC_VER
    5757#include <grp.h>
    5858#include <pwd.h>
    59 #endif 
     59#endif
    6060#include <stdio.h>
    6161#include <stdlib.h>
     
    109109        char *p;
    110110
     111        /* reinitialize globals */
    111112        argv0 = argv[0];
    112113        dflag = eval = fflag = iflag = Pflag = vflag = Wflag = stdin_ok = 0;
    113114        uid = 0;
     115
    114116        /* kmk: reset getopt and set program name. */
    115117        g_progname = argv[0];
     
    144146                return eval;
    145147        }
    146 #else   
     148#else
    147149        (void)p;
    148 #endif 
     150#endif
    149151        Pflag = rflag = 0;
    150152        while ((ch = getopt(argc, argv, "dfiPRrvW")) != -1)
     
    350352                                        rval = unlink(p->fts_accpath);
    351353                                }
    352 #endif 
     354#endif
    353355
    354356                                if (rval == 0 || (fflag && errno == ENOENT)) {
     
    435437                                        rval = unlink(f);
    436438                                }
    437 #endif 
     439#endif
    438440                        }
    439441                }
Note: See TracChangeset for help on using the changeset viewer.