From 7f3fdb47909893e0c8a51ed43f7b1768e8dd5604 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Sat, 8 Jul 2006 23:45:15 +0000 Subject: [PATCH] in titlebar(), don't display any blank space for the state if we're in the file browser, as Pico doesn't, and since path is always assumed to be NULL if DISABLE_BROWSER is defined, put the check for its being NULL in a DISABLE_BROWSER #define git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3769 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 5 +++++ src/winio.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 76b271e5..118a22a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -89,6 +89,11 @@ CVS code - titlebar() - Don't display overly long filenames with ellipses if the number of columns is extremely small. (DLR) + - Don't display any blank space for the state if we're in the + file browser, as Pico doesn't. (DLR) + - Since path is always assumed to be NULL if DISABLE_BROWSER is + defined, put the check for its being NULL in a DISABLE_BROWSER + #define. (DLR) - doc/syntax/c.nanorc: - Since .i and .ii are preprocessed C and C++ output, colorize them here. (Mike Frysinger) diff --git a/src/winio.c b/src/winio.c index b79e1079..2d7b2cbd 100644 --- a/src/winio.c +++ b/src/winio.c @@ -1964,7 +1964,7 @@ void titlebar(const char *path) * buffer. */ size_t statelen = 0; /* The length of the state in columns, or the length of - * "Modified" if the state is blank. */ + * "Modified" if the state is blank and path is NULL. */ char *exppath = NULL; /* The filename, expanded for display. */ bool newfie = FALSE; @@ -2010,7 +2010,11 @@ void titlebar(const char *path) state = openfile->modified ? _("Modified") : ISSET(VIEW_MODE) ? _("View") : ""; - statelen = strlenpt((state[0] != '\0') ? state : _("Modified")); + statelen = strlenpt((state[0] == '\0' +#ifndef DISABLE_BROWSER + && path == NULL +#endif + ) ? _("Modified") : state); /* If possible, add a space before state. */ if (space > 0 && statelen < space) @@ -2038,7 +2042,9 @@ void titlebar(const char *path) /* If we're not in the file browser, path should be the current * filename. */ +#ifndef DISABLE_BROWSER if (path == NULL) +#endif path = openfile->filename; /* Account for the full lengths of the prefix and the state. */ -- 2.39.5