-
Notifications
You must be signed in to change notification settings - Fork 396
Use XDG_STATE_HOME for jackdbus logs #967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -694,7 +694,7 @@ pathname_cat(const char *pathname_a, const char *pathname_b) | |
| bool | ||
| paths_init() | ||
| { | ||
| const char *home_dir, *xdg_config_home, *xdg_log_home; | ||
| const char *home_dir, *xdg_config_home, *xdg_state_home; | ||
|
|
||
| home_dir = getenv("HOME"); | ||
| if (home_dir == NULL) | ||
|
|
@@ -709,17 +709,21 @@ paths_init() | |
| if (!(xdg_config_home = pathname_cat(home_dir, DEFAULT_XDG_CONFIG))) goto fail; | ||
| } | ||
|
|
||
| if (!(xdg_log_home = pathname_cat(home_dir, DEFAULT_XDG_LOG))) goto fail; | ||
| xdg_state_home = getenv("XDG_STATE_HOME"); | ||
| if (xdg_state_home == NULL) | ||
| { | ||
| if (!(xdg_state_home = pathname_cat(home_dir, DEFAULT_XDG_STATE))) goto fail; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This leaks memory and is problematic in general. A pointer from That being said, none of the temporary allocations from |
||
| } | ||
|
|
||
| if (!(g_jackdbus_config_dir = pathname_cat(xdg_config_home, JACKDBUS_DIR))) goto fail; | ||
| if (!(g_jackdbus_log_dir = pathname_cat(xdg_log_home, JACKDBUS_DIR))) goto fail; | ||
| if (!(g_jackdbus_log_dir = pathname_cat(xdg_state_home, JACKDBUS_DIR))) goto fail; | ||
|
|
||
| if (!ensure_dir_exist(xdg_config_home, 0700)) | ||
| { | ||
| goto fail; | ||
| } | ||
|
|
||
| if (!ensure_dir_exist(xdg_log_home, 0700)) | ||
| if (!ensure_dir_exist(xdg_state_home, 0700)) | ||
| { | ||
| goto fail; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tabs are the wrong indentation style here. The whole file contains just a handful of tab-indented lines (which have been like that since 2008), all the rest is indented with 4 spaces. Now would be a good time to not replicate the exact original indentation for the changed lines, but instead to fix all of it. Please use 4 spaces for your changes,, and also fix the remaining old tab-indented lines in the function, there's like 5 of them.