commit 29be8031df44c010ad9d705c8aa5c5d22ee3ef52
parent c5fe41cec8f606f7e2e24932620777a4dcf12a0e
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Wed, 20 Apr 2005 14:55:46 +0000
comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2486 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -2848,7 +2848,7 @@ void load_history(void)
{
char *nanohist = histfilename();
- /* assume do_rcfile() has reported missing home dir */
+ /* Assume do_rcfile() has reported a missing home directory. */
if (nanohist != NULL) {
FILE *hist = fopen(nanohist, "r");
@@ -2892,7 +2892,7 @@ bool writehist(FILE *hist, historyheadtype *histhead)
{
historytype *h;
- /* write oldest first */
+ /* Write oldest history first. */
for (h = histhead->tail; h->prev != NULL; h = h->prev) {
size_t len = strlen(h->data);
@@ -2904,12 +2904,12 @@ bool writehist(FILE *hist, historyheadtype *histhead)
return TRUE;
}
-/* save histories to ~/.nano_history */
+/* Save histories to ~/.nano_history. */
void save_history(void)
{
char *nanohist;
- /* don't save unchanged or empty histories */
+ /* Don't save unchanged or empty histories. */
if ((search_history.count == 0 && replace_history.count == 0) ||
!ISSET(HISTORY_CHANGED) || ISSET(VIEW_MODE))
return;
@@ -2923,7 +2923,8 @@ void save_history(void)
rcfile_error(N_("Error writing %s: %s"), nanohist,
strerror(errno));
else {
- /* set rw only by owner for security ?? */
+ /* Make sure no one else can read from or write to the
+ * history file. */
chmod(nanohist, S_IRUSR | S_IWUSR);
if (!writehist(hist, &search_history) ||