Commit cf5b6a33f8e353efe79ca5bce71fb32dc1f55e42
Make paths starting with the tilde work on Windows
Author: xaizek
Author date (UTC): 2011-09-28 10:23
Committer name: xaizek
Committer date (UTC): 2011-09-28 10:23
Parent(s): 9a1f6a2f1288447dc2b9ee7f29355555b9b887f0
Signing key:
Tree: 584efb3b2aa69d52fb876fa0925937d1a75514d7
File src/utils.c changed (mode: 100644) (index b9c02d5df..50802d37f) |
... |
... |
replace_home_part(const char *directory) |
953 |
953 |
char * |
char * |
954 |
954 |
expand_tilde(char *path) |
expand_tilde(char *path) |
955 |
955 |
{ |
{ |
956 |
|
#ifndef _WIN32 |
|
957 |
956 |
char name[NAME_MAX]; |
char name[NAME_MAX]; |
958 |
957 |
char *p, *result; |
char *p, *result; |
|
958 |
|
#ifndef _WIN32 |
959 |
959 |
struct passwd *pw; |
struct passwd *pw; |
|
960 |
|
#endif |
960 |
961 |
|
|
961 |
962 |
if(path[0] != '~') |
if(path[0] != '~') |
962 |
963 |
return path; |
return path; |
|
... |
... |
expand_tilde(char *path) |
974 |
975 |
return result; |
return result; |
975 |
976 |
} |
} |
976 |
977 |
|
|
|
978 |
|
#ifndef _WIN32 |
977 |
979 |
if((p = strchr(path, '/')) == NULL) |
if((p = strchr(path, '/')) == NULL) |
978 |
980 |
{ |
{ |
979 |
981 |
p = path + strlen(path); |
p = path + strlen(path); |
File src/utils.h changed (mode: 100644) (index 2206610c0..6bc61d32b) |
... |
... |
char * realpath(const char *path, char *buf); |
120 |
120 |
int is_unc_path(const char *path); |
int is_unc_path(const char *path); |
121 |
121 |
int exec_program(TCHAR *cmd); |
int exec_program(TCHAR *cmd); |
122 |
122 |
int is_win_executable(const char *name); |
int is_win_executable(const char *name); |
|
123 |
|
int is_vista_and_above(void); |
123 |
124 |
#endif |
#endif |
124 |
125 |
|
|
125 |
126 |
#endif |
#endif |