[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] tweaks: adjust the indentation after the previous change
From: |
Benno Schulenberg |
Subject: |
[PATCH 2/2] tweaks: adjust the indentation after the previous change |
Date: |
Tue, 14 Jan 2020 16:24:30 +0100 |
Also reshuffle some lines, and adjust the comments.
---
src/nano.c | 6 ++----
src/rcfile.c | 29 ++++++++++++++---------------
2 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/src/nano.c b/src/nano.c
index 051ab9ce..a70dac67 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -1892,10 +1892,8 @@ int main(int argc, char **argv)
if (*(tail(argv[0])) == 'r')
SET(RESTRICTED);
- while ((optchr =
- getopt_long(argc, argv,
-
"ABC:DEFGHIJ:KLMNOPQ:RST:UVWX:Y:Zabcdef:ghijklmno:pr:s:tuvwxyz$",
- long_options, NULL)) != -1) {
+ while ((optchr = getopt_long(argc, argv,
"ABC:DEFGHIJ:KLMNOPQ:RST:UVWX:Y:Z"
+ "abcdef:ghijklmno:pr:s:tuvwxyz$", long_options,
NULL)) != -1) {
switch (optchr) {
#ifndef NANO_TINY
case 'A':
diff --git a/src/rcfile.c b/src/rcfile.c
index 11f9c760..936a00b6 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -1642,32 +1642,31 @@ bool have_nanorc(const char *path, const char *name)
return is_good_file(nanorc);
}
-/* First read the system-wide rcfile, then the user's rcfile. */
+/* Process the nanorc file that was specified on the command line (if any),
+ * and otherwise the system-wide rcfile followed by the user's rcfile. */
void do_rcfiles(void)
{
- const char *xdgconfdir;
-
if (custom_nanorc)
nanorc = custom_nanorc;
else
nanorc = mallocstrcpy(nanorc, SYSCONFDIR "/nanorc");
- /* First process the system-wide nanorc, if it exists and is suitable.
*/
if (is_good_file(nanorc))
parse_one_nanorc();
if (custom_nanorc == NULL) {
- get_homedir();
- xdgconfdir = getenv("XDG_CONFIG_HOME");
-
- /* Now try the to find a nanorc file in the user's home directory or in
- * the XDG configuration directories, and process the first one found.
*/
- if (have_nanorc(homedir, "/" HOME_RC_NAME) ||
- have_nanorc(xdgconfdir, "/nano/" RCFILE_NAME) ||
- have_nanorc(homedir, "/.config/nano/"
RCFILE_NAME))
- parse_one_nanorc();
- else if (homedir == NULL && xdgconfdir == NULL)
- jot_error(N_("I can't find my home directory! Wah!"));
+ const char *xdgconfdir = getenv("XDG_CONFIG_HOME");
+
+ get_homedir();
+
+ /* Now try to find a nanorc file in the user's home directory
or in the
+ * XDG configuration directories, and process the first one
found. */
+ if (have_nanorc(homedir, "/" HOME_RC_NAME) ||
+ have_nanorc(xdgconfdir, "/nano/"
RCFILE_NAME) ||
+ have_nanorc(homedir, "/.config/nano/"
RCFILE_NAME))
+ parse_one_nanorc();
+ else if (homedir == NULL && xdgconfdir == NULL)
+ jot_error(N_("I can't find my home directory! Wah!"));
}
check_vitals_mapped();
--
2.24.1