From 11072ed5877eb82af4cf6d5651ea7fa25a7816a9 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 6 Aug 2017 13:32:44 +0200
Subject: [PATCH] tweaks: sort the includes, so it's a little easier to see
 what is there

---
 src/browser.c |  2 +-
 src/chars.c   |  2 +-
 src/color.c   |  5 ++---
 src/files.c   |  8 ++++----
 src/help.c    |  2 +-
 src/nano.c    | 16 ++++++++--------
 src/rcfile.c  |  4 ++--
 src/text.c    |  6 +++---
 src/utils.c   |  6 +++---
 src/winio.c   |  3 +--
 10 files changed, 26 insertions(+), 28 deletions(-)

diff --git a/src/browser.c b/src/browser.c
index 51ea37fa..df980795 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -21,10 +21,10 @@
 
 #include "proto.h"
 
+#include <errno.h>
 #include <stdint.h>
 #include <string.h>
 #include <unistd.h>
-#include <errno.h>
 
 #ifdef ENABLE_BROWSER
 
diff --git a/src/chars.c b/src/chars.c
index d2d87a38..fa8457d0 100644
--- a/src/chars.c
+++ b/src/chars.c
@@ -21,8 +21,8 @@
 
 #include "proto.h"
 
-#include <string.h>
 #include <ctype.h>
+#include <string.h>
 
 #ifdef ENABLE_UTF8
 #include <wchar.h>
diff --git a/src/color.c b/src/color.c
index fe925866..e61e89ae 100644
--- a/src/color.c
+++ b/src/color.c
@@ -21,13 +21,12 @@
 
 #include "proto.h"
 
-#include <string.h>
 #include <errno.h>
-#include <unistd.h>
-
 #ifdef HAVE_MAGIC_H
 #include <magic.h>
 #endif
+#include <string.h>
+#include <unistd.h>
 
 #ifndef DISABLE_COLOR
 
diff --git a/src/files.c b/src/files.c
index 573c449a..1e4e4603 100644
--- a/src/files.c
+++ b/src/files.c
@@ -21,14 +21,14 @@
 
 #include "proto.h"
 
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
 #include <errno.h>
+#include <fcntl.h>
+#include <libgen.h>
 #ifdef HAVE_PWD_H
 #include <pwd.h>
 #endif
-#include <libgen.h>
+#include <string.h>
+#include <unistd.h>
 
 #define LOCKBUFSIZE 8192
 
diff --git a/src/help.c b/src/help.c
index 85ba6b51..76181cdc 100644
--- a/src/help.c
+++ b/src/help.c
@@ -22,8 +22,8 @@
 
 #include "proto.h"
 
-#include <string.h>
 #include <errno.h>
+#include <string.h>
 
 #ifdef ENABLE_HELP
 
diff --git a/src/nano.c b/src/nano.c
index 1bb67761..935e07c4 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -22,22 +22,22 @@
 #include "proto.h"
 #include "revision.h"
 
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
 #include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <getopt.h>
+#ifndef NANO_TINY
+#include <sys/ioctl.h>
+#endif
 #ifdef ENABLE_UTF8
 #include <langinfo.h>
 #endif
 #include <locale.h>
+#include <string.h>
 #ifdef HAVE_TERMIOS_H
 #include <termios.h>
 #endif
-#include <getopt.h>
-#ifndef NANO_TINY
-#include <sys/ioctl.h>
-#endif
+#include <unistd.h>
 
 #ifdef ENABLE_MOUSE
 static int oldinterval = -1;
diff --git a/src/rcfile.c b/src/rcfile.c
index 74348f5b..db9f6fba 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -22,11 +22,11 @@
 
 #include "proto.h"
 
+#include <ctype.h>
+#include <errno.h>
 #include <glob.h>
 #include <string.h>
-#include <errno.h>
 #include <unistd.h>
-#include <ctype.h>
 
 #ifdef ENABLE_NANORC
 
diff --git a/src/text.c b/src/text.c
index ef3c80b1..6fb72c2b 100644
--- a/src/text.c
+++ b/src/text.c
@@ -24,11 +24,11 @@
 
 #include "proto.h"
 
-#include <unistd.h>
-#include <string.h>
+#include <errno.h>
 #include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
 #include <sys/wait.h>
-#include <errno.h>
 
 #ifndef NANO_TINY
 static pid_t pid = -1;
diff --git a/src/utils.c b/src/utils.c
index f3000e5c..9cb53a41 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -21,12 +21,12 @@
 
 #include "proto.h"
 
-#include <string.h>
-#include <unistd.h>
+#include <errno.h>
 #ifdef HAVE_PWD_H
 #include <pwd.h>
 #endif
-#include <errno.h>
+#include <string.h>
+#include <unistd.h>
 
 /* Return the user's home directory.  We use $HOME, and if that fails,
  * we fall back on the home directory of the effective user ID. */
diff --git a/src/winio.c b/src/winio.c
index e3aa1221..31da9387 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -22,12 +22,11 @@
 #include "proto.h"
 #include "revision.h"
 
+#include <ctype.h>
 #ifdef __linux__
 #include <sys/ioctl.h>
 #endif
-
 #include <string.h>
-#include <ctype.h>
 
 #ifdef REVISION
 #define BRANDING REVISION
-- 
GitLab