diff options
Diffstat (limited to 'src/H5Flow.c')
-rw-r--r-- | src/H5Flow.c | 68 |
1 files changed, 32 insertions, 36 deletions
diff --git a/src/H5Flow.c b/src/H5Flow.c index c1b426d..2570930 100644 --- a/src/H5Flow.c +++ b/src/H5Flow.c @@ -492,47 +492,43 @@ H5F_low_access(const H5F_low_class_t *type, const char *name, if (key) { #ifdef WIN32 - -/* - some windows specific types. the LPSTR is just a char* -*/ - LPSTR pathbuf = NULL; - LPSTR *namebuf = NULL; - int bufsize = 0; - - + /* + * Some windows specific types. the LPSTR is just a char* + */ + LPSTR pathbuf = NULL; + LPSTR *namebuf = NULL; + int bufsize = 0; + + + /* + * Gets the full path of the file name. the if statement below + * is to try to distinguish if we have the ablosute path already + */ + if ((*(name+1) != ':') && (*(name+2)!= '\\')){ /* - gets the full path of the file name. the if statement below is to try - to distinguish if we have the ablosute path already - */ - - if ((*(name+1) != ':') && (*(name+2)!= '\\')){ - /* - if the size of the buffer is too small it will return - the appropriate size of the buffer not including the null - */ - bufsize = GetFullPathName(name,bufsize,pathbuf,namebuf); - if (bufsize != 0){ - pathbuf = malloc(sizeof(char) * (bufsize + 1)); - namebuf = malloc(sizeof(char) * (bufsize + 1)); - bufsize++; - GetFullPathName(name,bufsize,pathbuf,namebuf); - } - else { - pathbuf = NULL; - } - } - else { - pathbuf = malloc(strlen(name)); - strcpy(pathbuf,name); + * if the size of the buffer is too small it will return + * the appropriate size of the buffer not including the null + */ + bufsize = GetFullPathName(name,bufsize,pathbuf,namebuf); + if (bufsize != 0){ + pathbuf = malloc(sizeof(char) * (bufsize + 1)); + namebuf = malloc(sizeof(char) * (bufsize + 1)); + bufsize++; + GetFullPathName(name,bufsize,pathbuf,namebuf); + } else { + pathbuf = NULL; } + } else { + pathbuf = malloc(strlen(name)); + strcpy(pathbuf,name); + } - key->path = pathbuf; - key->dev = 0; - key->ino = 0; + key->path = pathbuf; + key->dev = 0; + key->ino = 0; #else HDstat(name, &sb); - key->path = NULL; + key->path = NULL; key->dev = sb.st_dev; key->ino = sb.st_ino; #endif |