Mercurial > trustbridge
comparison common/portpath.c @ 164:6d64d7e9fa32
Implemented port_dirname for windows.
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Tue, 25 Mar 2014 12:01:26 +0100 |
parents | 306e4db11761 |
children | d47de01d6ad7 |
comparison
equal
deleted
inserted
replaced
158:fb3b2d77518f | 164:6d64d7e9fa32 |
---|---|
10 port_dirname(char *path) | 10 port_dirname(char *path) |
11 { | 11 { |
12 #ifndef _WIN32 | 12 #ifndef _WIN32 |
13 return dirname(path); | 13 return dirname(path); |
14 #else | 14 #else |
15 fprintf(stderr, "Windows Suport missing!"); | 15 char drive[_MAX_DRIVE]; |
16 abort(); | 16 char dir[_MAX_DIR]; |
17 _splitpath(path, drive, dir, NULL, NULL); | |
18 /* We assume: drive + dir is shorter than | |
19 * drive + dir + fname + ext */ | |
20 sprintf(path, "%s%s", drive, dir); | |
21 return path; | |
17 #endif | 22 #endif |
18 | |
19 } | 23 } |
20 | 24 |
21 char * | 25 char * |
22 port_realpath(char *path) | 26 port_realpath(char *path) |
23 { | 27 { |