Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/scripts/basic


Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
Location:
branches/2.2.9/mindi-busybox/scripts/basic
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/scripts/basic/docproc.c

    r1765 r2725  
    8080    pid_t pid;
    8181    int ret;
    82     char real_filename[PATH_MAX + 1];
     82    char *real_filename;
     83    int rflen;
     84
    8385    /* Make sure output generated so far are flushed */
    8486    fflush(stdout);
    8587    switch(pid=fork()) {
    8688        case -1:
    87             perror("fork");
     89            perror("vfork"+1);
    8890            exit(1);
    8991        case  0:
    90             memset(real_filename, 0, sizeof(real_filename));
    91             strncat(real_filename, getenv("SRCTREE"), PATH_MAX);
    92             strncat(real_filename, KERNELDOCPATH KERNELDOC,
    93                     PATH_MAX - strlen(real_filename));
     92            rflen  = strlen(getenv("SRCTREE"));
     93            rflen += strlen(KERNELDOCPATH KERNELDOC);
     94            real_filename = alloca(rflen + 1);
     95            strcpy(real_filename, getenv("SRCTREE"));
     96            strcat(real_filename, KERNELDOCPATH KERNELDOC);
    9497            execvp(real_filename, svec);
    9598            fprintf(stderr, "exec ");
     
    167170    char line[MAXLINESZ];
    168171    if (filename_exist(filename) == NULL) {
    169         char real_filename[PATH_MAX + 1];
    170         memset(real_filename, 0, sizeof(real_filename));
    171         strncat(real_filename, getenv("SRCTREE"), PATH_MAX);
    172         strncat(real_filename, filename,
    173                 PATH_MAX - strlen(real_filename));
     172        int rflen = strlen(getenv("SRCTREE")) + strlen(filename);
     173        char *real_filename = alloca(rflen + 1);
     174        strcpy(real_filename, getenv("SRCTREE"));
     175        strcat(real_filename, filename);
    174176        sym = add_new_file(filename);
    175177        fp = fopen(real_filename, "r");
     
    250252
    251253/*
    252  * Document spåecific function(s) in a file.
     254 * Document specific function(s) in a file.
    253255 * Call kernel-doc with the following parameters:
    254256 * kernel-doc -docbook -function function1 [-function function2]
     
    396398    return exitstatus;
    397399}
    398 
  • branches/2.2.9/mindi-busybox/scripts/basic/fixdep.c

    r1765 r2725  
    204204void use_config(char *m, int slen)
    205205{
    206     char s[PATH_MAX];
     206    char *s = alloca(slen+1);
    207207    char *p;
    208208
     
    226226{
    227227    /* modified for bbox */
    228     char *end_4 = map + len - 4; /* 4 == length of "USE_" */
     228    char *end_3 = map + len - 3; /* 3 == length of "IF_" */
    229229    char *end_7 = map + len - 7;
    230230    char *p = map;
     
    232232    int off;
    233233
    234     for (; p < end_4; p++) {
     234    for (; p <= end_3; p++) {
     235        /* Find next identifier's beginning */
     236        if (!(isalnum(*p) || *p == '_'))
     237            continue;
     238
     239        /* Check it */
    235240        if (p < end_7 && p[6] == '_') {
    236241            if (!memcmp(p, "CONFIG", 6)) goto conf7;
    237242            if (!memcmp(p, "ENABLE", 6)) goto conf7;
    238         }
    239         /* We have at least 5 chars: for() has
    240          * "p < end-4", not "p <= end-4"
    241          * therefore we don't need to check p <= end-5 here */
    242         if (p[4] == '_')
    243             if (!memcmp(p, "SKIP", 4)) goto conf5;
    244         /* Ehhh, gcc is too stupid to just compare it as 32bit int */
    245         if (p[0] == 'U')
    246             if (!memcmp(p, "USE_", 4)) goto conf4;
     243            if (!memcmp(p, "IF_NOT", 6)) goto conf7;
     244        }
     245        /* we have at least 3 chars because of p <= end_3 */
     246        /*if (!memcmp(p, "IF_", 3)) ...*/
     247        if (p[0] == 'I' && p[1] == 'F' && p[2] == '_') {
     248            off = 3;
     249            goto conf;
     250        }
     251
     252        /* This identifier is not interesting, skip it */
     253        while (p <= end_3 && (isalnum(*p) || *p == '_'))
     254            p++;
    247255        continue;
    248256
    249     conf4:  off = 4;
    250     conf5:  off = 5;
    251257    conf7:  off = 7;
     258    conf:
    252259        p += off;
    253         for (q = p; q < end_4+4; q++) {
     260        for (q = p; q < end_3+3; q++) {
    254261            if (!(isalnum(*q) || *q == '_'))
    255262                break;
    256263        }
    257         use_config(p, q-p);
     264        if (q != p) {
     265            use_config(p, q-p);
     266        }
    258267    }
    259268}
     
    307316    char *end = m + len;
    308317    char *p;
    309     char s[PATH_MAX];
     318    char *s = alloca(len);
    310319
    311320    p = memchr(m, ':', len);
  • branches/2.2.9/mindi-busybox/scripts/basic/split-include.c

    r1765 r2725  
    111111    if (line[0] != '#')
    112112        continue;
    113     if ((str_config = strstr(line, "CONFIG_")) == NULL)
     113    if ((str_config = strstr(line, " CONFIG_")) == NULL)
    114114        continue;
    115115
    116     /* Make the output file name. */
    117     str_config += sizeof("CONFIG_") - 1;
     116    /* We found #define CONFIG_foo or #undef CONFIG_foo.
     117     * Make the output file name. */
     118    str_config += sizeof(" CONFIG_") - 1;
    118119    for (itarget = 0; !isspace(str_config[itarget]); itarget++)
    119120    {
     
    155156
    156157        /* Write the file. */
    157         if ((fp_target = fopen(ptarget, "w" )) == NULL)
     158        if ((fp_target = fopen(ptarget,  "w")) == NULL)
    158159        ERROR_EXIT(ptarget);
    159160        fputs(line, fp_target);
Note: See TracChangeset for help on using the changeset viewer.