aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/os/stdpaths.c18
-rw-r--r--src/nvim/path.c7
2 files changed, 5 insertions, 20 deletions
diff --git a/src/nvim/os/stdpaths.c b/src/nvim/os/stdpaths.c
index e242cd3d69..167a53c985 100644
--- a/src/nvim/os/stdpaths.c
+++ b/src/nvim/os/stdpaths.c
@@ -64,18 +64,6 @@ static char *get_xdg_home(const XDGVarType idx)
return dir;
}
-static void create_dir(const char *dir, int mode)
- FUNC_ATTR_NONNULL_ALL
-{
- char *failed;
- int err;
- if ((err = os_mkdir_recurse(dir, mode, &failed)) != 0) {
- EMSG3(_("E920: Failed to create data directory %s: %s"), failed,
- os_strerror(-err));
- xfree(failed);
- }
-}
-
char *stdpaths_user_conf_subpath(const char *fname)
FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
{
@@ -85,9 +73,5 @@ char *stdpaths_user_conf_subpath(const char *fname)
char *stdpaths_user_data_subpath(const char *fname)
FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
{
- char *dir = concat_fnames_realloc(get_xdg_home(kXDGDataHome), fname, true);
- if (!os_isdir((char_u *)dir)) {
- create_dir(dir, 0755);
- }
- return dir;
+ return concat_fnames_realloc(get_xdg_home(kXDGDataHome), fname, true);
}
diff --git a/src/nvim/path.c b/src/nvim/path.c
index a0bba450cd..e30f6b08d9 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -364,7 +364,7 @@ static inline char *do_concat_fnames(char *fname1, const size_t len1,
/// if necessary
/// @return [allocated] Concatenation of fname1 and fname2.
char *concat_fnames(const char *fname1, const char *fname2, bool sep)
- FUNC_ATTR_NONNULL_ARG(1, 2) FUNC_ATTR_NONNULL_RET
+ FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_RET
{
const size_t len1 = strlen(fname1);
const size_t len2 = strlen(fname2);
@@ -376,7 +376,8 @@ char *concat_fnames(const char *fname1, const char *fname2, bool sep)
/// Concatenate file names fname1 and fname2
///
/// Like concat_fnames(), but in place of allocating new memory it reallocates
-/// fname1. For this reason fname1 must be allocated with xmalloc.
+/// fname1. For this reason fname1 must be allocated with xmalloc, and can no
+/// longer be used after running concat_fnames_realloc.
///
/// @param fname1 is the first part of the path or filename
/// @param fname2 is the second half of the path or filename
@@ -384,7 +385,7 @@ char *concat_fnames(const char *fname1, const char *fname2, bool sep)
/// if necessary
/// @return [allocated] Concatenation of fname1 and fname2.
char *concat_fnames_realloc(char *fname1, const char *fname2, bool sep)
- FUNC_ATTR_NONNULL_ARG(1, 2) FUNC_ATTR_NONNULL_RET
+ FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_RET
{
const size_t len1 = strlen(fname1);
const size_t len2 = strlen(fname2);