Skip to content

Commit f92ebbe

Browse files
Mikachu2333ccmywish
authored andcommitted
消歧义chsrc_make_tmpfile的参数
1 parent 5ccd609 commit f92ebbe

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/framework/core.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,14 +1387,14 @@ chsrc_run_directly (const char *cmd)
13871387
* @brief 在本目录创建一个临时文件
13881388
*
13891389
* @param[in] filename 文件名,不包含后缀名
1390-
* @oaram[in] postfix 后缀名,需要自己加 '.'
1391-
* @oaram[in] loud 创建成功时是否提示用户
1392-
* @param[out] tmpfilename 生成的临时文件名,可以为 NULL
1390+
* @param[in] postfix 后缀名,需要自己加 '.'
1391+
* @param[in] loud 创建成功时是否提示用户
1392+
* @param[out] tmpfilepath 生成的临时文件名,非 Windows 可以为 NULL
13931393
*
13941394
* @return 返回一个 FILE*,调用者需要关闭该文件
13951395
*/
13961396
FILE *
1397-
chsrc_make_tmpfile (char *filename, char *postfix, bool loud, char **tmpfilename)
1397+
chsrc_make_tmpfile (char *filename, char *postfix, bool loud, char **tmpfilepath)
13981398
{
13991399
#ifdef XY_Build_On_Windows
14001400
/**
@@ -1430,18 +1430,18 @@ chsrc_make_tmpfile (char *filename, char *postfix, bool loud, char **tmpfilename
14301430

14311431
/**
14321432
* 允许生成文件后不了解其文件名,调用者只了解 FILE*
1433-
* 这样的话,其实是是无法删除该文件的,但是生成在 /tmp 目录下我们恰好可以不用清理
1433+
* 这样的话,其实是无法删除该文件的,但是生成在 /tmp 目录下我们恰好可以不用清理
14341434
* 但是在 Windows 上,就没有办法了,所以我们禁止在 Windows 上不指定返回出的临时文件名
14351435
*/
1436-
if (xy.on_windows && !tmpfilename)
1436+
if (xy.on_windows && !tmpfilepath)
14371437
{
14381438
chsrc_error2 ("在 Windows 上,创建临时文件时必须指定返回的临时文件名");
14391439
xy_unreached();
14401440
}
14411441

1442-
if (tmpfilename)
1442+
if (tmpfilepath)
14431443
{
1444-
*tmpfilename = xy_strdup (tmpfile);
1444+
*tmpfilepath = xy_normalize_path (xy_strdup (tmpfile));
14451445
}
14461446

14471447
return f;

0 commit comments

Comments
 (0)