Skip to content

Commit 0edaf81

Browse files
author
Mikachu2333
committed
add warnings xy.h
1 parent b51e8f3 commit 0edaf81

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/xy.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,8 @@ xy_dir_exist (const char *path)
975975
* @details 1. 删除路径左右两边多出来的空白符
976976
* 2. 将 `~/` 转换为绝对路径
977977
*
978-
* @warning 开头结尾的 `/` 或 `\\` 均不会删除,拼接路径时需要确认
978+
* @warning 1. 开头结尾的 `/` 或 `\\` 均不会删除,拼接路径时需要确认
979+
* 2. 在 Windows 上传入 `~` 将不会返回 HOME 目录,而是返回 `.`
979980
*/
980981
static char *
981982
xy_normalize_path (const char *path)
@@ -1005,6 +1006,10 @@ xy_normalize_path (const char *path)
10051006
}
10061007

10071008

1009+
/**
1010+
* @warning 如果传入的路径以 `\` 或者 `/` 结尾,本函数将直接去除斜杠
1011+
* 并且不会进一步处理为传入路径的父目录
1012+
*/
10081013
static char *
10091014
xy_parent_dir (const char *path)
10101015
{

0 commit comments

Comments
 (0)