diff options
author | liljencrantz <liljencrantz@gmail.com> | 2007-09-21 03:52:43 +1000 |
---|---|---|
committer | liljencrantz <liljencrantz@gmail.com> | 2007-09-21 03:52:43 +1000 |
commit | 607e97065958640f09dbe5de103bae0fd7c350c5 (patch) | |
tree | 6ef09ac0199696b492f9af97089f883df43163b9 /path.h | |
parent | 3b39b1fa0302dcb0757b060a4255b84bee83d540 (diff) |
Further improve accuracy of cd builtins error messages. Now correctly reports rotten symlinks.
darcs-hash:20070920175243-75c98-e210034c7bfc8308be9e03017a5a0d8ef7648b9c.gz
Diffstat (limited to 'path.h')
-rw-r--r-- | path.h | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -9,6 +9,8 @@ #ifndef FISH_PATH_H #define FISH_PATH_H +#define EROTTEN 1 + /** Returns the user configuration directory for fish. If the directory or one of it's parents doesn't exist, they are first created. @@ -28,19 +30,24 @@ wchar_t *path_get_config( void *context); wchar_t *path_get_path( void *context, const wchar_t *cmd ); /** - Returns the full path of the specified directory. If the \c in is a - full path to an existing directory, a copy of the string is - returned. If \c in is a directory relative to one of the - directories i the CDPATH, the full path is returned. If no - directory can be found, 0 is returned. - + Returns the full path of the specified directory, using the CDPATH + variable as a list of base directories for relative paths. The + returned string is allocated using halloc and the specified + context. + + If no valid path is found, null is returned and errno is set to + ENOTDIR if at least one such path was found, but it did not point + to a directory, EROTTEN if a arotten symbolic link was found, or + ENOENT if no file of the specified name was found. If both a rotten + symlink and a file are found, it is undefined which error status + will be returned. + \param in The name of the directory. \param context the halloc context to use for memory allocations \return 0 if the command can not be found, the path of the command otherwise. */ wchar_t *path_get_cdpath( void *context, wchar_t *in ); - wchar_t *path_make_canonical( void *context, const wchar_t *path ); |