Skip to content

Commit

Permalink
工作目录路径去除首尾双引号
Browse files Browse the repository at this point in the history
  • Loading branch information
lc-soft committed Dec 23, 2024
1 parent 6c52789 commit 4e8e7b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
int main(int argc, char *argv[])
{
#ifndef DEBUG
char *dirname = path_dirname(argv[0]);
char *bin_path = malloc(sizeof(char) * (strlen(argv[0]) + 1));
strtrim(bin_path, argv[0], "\"");
char *dirname = path_dirname(bin_path);
chdir(dirname);
free(bin_path);
free(dirname);
#endif

Expand Down

0 comments on commit 4e8e7b8

Please sign in to comment.