VirtualBox

Changeset 936 in kBuild for trunk/src


Ignore:
Timestamp:
May 26, 2007 6:42:30 PM (18 years ago)
Author:
bird
Message:

wrap rmdir as well (the stupid trailing slash problem).

Location:
trunk/src/gmakenew/kmkbuiltin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gmakenew/kmkbuiltin/mscfakes.c

    r785 r936  
    3333#include "err.h"
    3434#include "mscfakes.h"
    35 #undef mkdir
    3635
    3736
     
    5352int mkdir_msc(const char *path, mode_t mode)
    5453{
    55     int rc = mkdir(path);
     54    int rc = (mkdir)(path);
    5655    if (rc)
    5756    {
     
    6261            while (len > 0 && (str[len - 1] == '/' || str[len - 1] == '\\'))
    6362                str[--len] = '\0';
    64             rc = mkdir(str);
     63            rc = (mkdir)(str);
     64            free(str);
     65        }
     66    }
     67    return rc;
     68}
     69
     70int rmdir_msc(const char *path)
     71{
     72    int rc = (rmdir)(path);
     73    if (rc)
     74    {
     75        int len = strlen(path);
     76        if (len > 0 && (path[len - 1] == '/' || path[len - 1] == '\\'))
     77        {
     78            char *str = strdup(path);
     79            while (len > 0 && (str[len - 1] == '/' || str[len - 1] == '\\'))
     80                str[--len] = '\0';
     81            rc = (rmdir)(str);
    6582            free(str);
    6683        }
  • trunk/src/gmakenew/kmkbuiltin/mscfakes.h

    r809 r936  
    122122#define readlink(link, buf, size) -1
    123123#define reallocf(old, size) realloc(old, size)
     124int rmdir_msc(const char *path);
     125#define rmdir(path) rmdir_msc(path)
    124126intmax_t strtoimax(const char *nptr, char **endptr, int base);
    125127uintmax_t strtoumax(const char *nptr, char **endptr, int base);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette