nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 413116e1b5f53b8e1df501ea407739844d8e7642
parent 69a3d39bc4610efc147e9c7104c42008593097ff
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue, 17 Sep 2019 16:46:11 +0200

tweaks: rename another variable, for a better fit

Diffstat:
Msrc/files.c | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/files.c b/src/files.c @@ -1231,7 +1231,7 @@ char *get_full_path(const char *origpath) int attempts = 0; /* How often we've tried climbing back up the tree. */ struct stat fileinfo; - char *currentdir, *here, *target, *just_filename = NULL; + char *allocation, *here, *target, *just_filename = NULL; char *last_slash; bool path_only; @@ -1241,12 +1241,12 @@ char *get_full_path(const char *origpath) /* Get the current directory. If it doesn't exist, back up and try * again until we get a directory that does, and use that as the * current directory. */ - currentdir = charalloc(PATH_MAX + 1); - here = getcwd(currentdir, PATH_MAX + 1); + allocation = charalloc(PATH_MAX + 1); + here = getcwd(allocation, PATH_MAX + 1); while (here == NULL && attempts < 20) { IGNORE_CALL_RESULT(chdir("..")); - here = getcwd(currentdir, PATH_MAX + 1); + here = getcwd(allocation, PATH_MAX + 1); attempts++; } @@ -1261,7 +1261,7 @@ char *get_full_path(const char *origpath) /* Otherwise, set here to "". */ } else { here = mallocstrcpy(NULL, ""); - free(currentdir); + free(allocation); } target = real_dir_from_tilde(origpath); @@ -1305,8 +1305,8 @@ char *get_full_path(const char *origpath) free(target); /* Get the full path. */ - currentdir = charalloc(PATH_MAX + 1); - target = getcwd(currentdir, PATH_MAX + 1); + allocation = charalloc(PATH_MAX + 1); + target = getcwd(allocation, PATH_MAX + 1); /* If we succeeded, canonicalize it in target. */ if (target != NULL) { @@ -1319,7 +1319,7 @@ char *get_full_path(const char *origpath) /* Otherwise, make sure that we return NULL. */ } else { path_only = TRUE; - free(currentdir); + free(allocation); } /* Finally, go back to the path specified in here,