From 6335fb54d518d509deddc78838f267d2c576e03d Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Mon, 1 Jan 2007 05:15:32 +0000 Subject: [PATCH] miscellaneous comment fixes git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4012 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 4 ++++ src/browser.c | 4 ++-- src/chars.c | 7 +++---- src/color.c | 4 ++-- src/cut.c | 10 +++++----- src/files.c | 6 +++--- src/global.c | 4 ++-- src/help.c | 4 ++-- src/move.c | 8 +++----- src/nano.c | 4 ++-- src/nano.h | 4 ++-- src/prompt.c | 4 ++-- src/proto.h | 35 +++++++++++++++++------------------ src/rcfile.c | 5 ++--- src/search.c | 4 ++-- src/text.c | 6 +++--- src/utils.c | 4 ++-- src/winio.c | 8 ++++---- 18 files changed, 62 insertions(+), 63 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4b33f4c6..ac9b76cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ CVS code - +- General: + - Miscellaneous comment fixes. (DLR) + do_credits() + - Update the last copyright notice to include 2006. (DLR) - README: - Add more miscellaneous cosmetic fixes. (DLR) - doc/syntax/python.nanorc: diff --git a/src/browser.c b/src/browser.c index a37cf599..a1393fb6 100644 --- a/src/browser.c +++ b/src/browser.c @@ -3,7 +3,7 @@ * browser.c * * * * Copyright (C) 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -57,7 +57,7 @@ char *do_browser(char *path, DIR *dir) /* The directory we were in, if any, before backing up via * browsing to "..". */ char *ans = NULL; - /* The last answer the user typed on the statusbar. */ + /* The last answer the user typed at the statusbar prompt. */ size_t old_selected; /* The selected file we had before the current selected file. */ diff --git a/src/chars.c b/src/chars.c index 7efb9a5e..5ab12f7a 100644 --- a/src/chars.c +++ b/src/chars.c @@ -3,7 +3,7 @@ * chars.c * * * * Copyright (C) 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -38,9 +38,8 @@ static bool use_utf8 = FALSE; /* Whether we've enabled UTF-8 support. */ static const wchar_t bad_wchar = 0xFFFD; /* If we get an invalid multibyte sequence, we treat it as - * Unicode FFFD (Replacement Character), unless we're - * determining if it's a control character or searching for a - * match to it. */ + * Unicode FFFD (Replacement Character), unless we're searching + * for a match to it. */ static const char *const bad_mbchar = "\xEF\xBF\xBD"; static const int bad_mbchar_len = 3; diff --git a/src/color.c b/src/color.c index 5d5918b6..9dfd9bbd 100644 --- a/src/color.c +++ b/src/color.c @@ -3,7 +3,7 @@ * color.c * * * * Copyright (C) 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -29,7 +29,7 @@ #ifdef ENABLE_COLOR /* For each syntax list entry, go through the list of colors and assign - * color pairs. */ + * the color pairs. */ void set_colorpairs(void) { const syntaxtype *this_syntax = syntaxes; diff --git a/src/cut.c b/src/cut.c index 2c15b410..0af512ae 100644 --- a/src/cut.c +++ b/src/cut.c @@ -3,7 +3,7 @@ * cut.c * * * * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -146,7 +146,7 @@ void do_cut_text( if (copy_text) { if (cutbuffer != NULL) { /* If the cutbuffer isn't empty, save where it currently - * ends. This is where the new text will be added. */ + * ends. This is where we'll add the new text. */ cb_save = cutbottom; cb_save_len = strlen(cutbottom->data); } @@ -173,12 +173,12 @@ void do_cut_text( cut_marked(); openfile->mark_set = FALSE; } else if (ISSET(CUT_TO_END)) - /* Otherwise, if the CUT_TO_END flag is set, move all text up to - * the end of the line into the cutbuffer. */ + /* If the CUT_TO_END flag is set, move all text up to the end of + * the line into the cutbuffer. */ cut_to_eol(); else #endif - /* Otherwise, move the entire line into the cutbuffer. */ + /* Move the entire line into the cutbuffer. */ cut_line(); #ifndef NANO_TINY diff --git a/src/files.c b/src/files.c index 65b42cdc..783da1d8 100644 --- a/src/files.c +++ b/src/files.c @@ -3,7 +3,7 @@ * files.c * * * * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -681,7 +681,7 @@ void do_insertfile( int i; const char *msg; char *ans = mallocstrcpy(NULL, ""); - /* The last answer the user typed on the statusbar. */ + /* The last answer the user typed at the statusbar prompt. */ filestruct *edittop_save = openfile->edittop; size_t current_x_save = openfile->current_x; ssize_t current_y_save = openfile->current_y; @@ -1752,7 +1752,7 @@ int do_writeout(bool exiting) int i, retval = 0; append_type append = OVERWRITE; char *ans; - /* The last answer the user typed on the statusbar. */ + /* The last answer the user typed at the statusbar prompt. */ #ifdef NANO_EXTRA static bool did_credits = FALSE; #endif diff --git a/src/global.c b/src/global.c index 2eb31b3b..73b9e733 100644 --- a/src/global.c +++ b/src/global.c @@ -3,7 +3,7 @@ * global.c * * * * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -110,7 +110,7 @@ size_t quotelen; #endif char *answer = NULL; - /* The answer string used in the statusbar prompt. */ + /* The answer string used by the statusbar prompt. */ ssize_t tabsize = -1; /* The width of a tab in spaces. The default value is set in diff --git a/src/help.c b/src/help.c index ac06a5b4..8ca5490b 100644 --- a/src/help.c +++ b/src/help.c @@ -3,7 +3,7 @@ * help.c * * * * Copyright (C) 2000, 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -51,7 +51,7 @@ void do_help(void (*refresh_func)(void)) /* The current shortcut list. */ #endif const char *ptr; - /* The current line of help text. */ + /* The current line of the help text. */ size_t old_line = (size_t)-1; /* The line we were on before the current line. */ diff --git a/src/move.c b/src/move.c index d217501e..e1d90768 100644 --- a/src/move.c +++ b/src/move.c @@ -3,7 +3,7 @@ * move.c * * * * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -272,8 +272,7 @@ bool do_next_word(bool allow_punct, bool allow_update) free(char_mb); - /* If we haven't found it, leave the cursor at the end of the - * file. */ + /* If we haven't found it, move to the end of the file. */ if (openfile->current == NULL) openfile->current = openfile->filebot; @@ -371,8 +370,7 @@ bool do_prev_word(bool allow_punct, bool allow_update) } } - /* If we haven't found it, leave the cursor at the beginning of the - * file. */ + /* If we haven't found it, move to the beginning of the file. */ if (openfile->current == NULL) openfile->current = openfile->fileage; /* If we've found it, move backward until we find the character diff --git a/src/nano.c b/src/nano.c index 4d12dc56..5584a591 100644 --- a/src/nano.c +++ b/src/nano.c @@ -3,7 +3,7 @@ * nano.c * * * * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -47,7 +47,7 @@ static bool no_rcfiles = FALSE; static struct termios oldterm; /* The user's original terminal settings. */ static struct sigaction act; - /* For all our fun signal handlers. */ + /* Used to set up all our fun signal handlers. */ /* Create a new filestruct node. Note that we do not set prevnode->next * to the new line. */ diff --git a/src/nano.h b/src/nano.h index 059e09b2..567c1398 100644 --- a/src/nano.h +++ b/src/nano.h @@ -3,7 +3,7 @@ * nano.h * * * * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -50,7 +50,7 @@ #define ISSET(bit) ((flags & bit) != 0) #define TOGGLE(bit) flags ^= bit -/* Macros for character allocation, etc. */ +/* Macros for character allocation and more. */ #define charalloc(howmuch) (char *)nmalloc((howmuch) * sizeof(char)) #define charealloc(ptr, howmuch) (char *)nrealloc(ptr, (howmuch) * sizeof(char)) #define charmove(dest, src, n) memmove(dest, src, (n) * sizeof(char)) diff --git a/src/prompt.c b/src/prompt.c index be3f636f..2bcd582d 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -3,7 +3,7 @@ * prompt.c * * * * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -28,7 +28,7 @@ #include static char *prompt = NULL; - /* The prompt string for statusbar questions. */ + /* The prompt string used for statusbar questions. */ static size_t statusbar_x = (size_t)-1; /* The cursor position in answer. */ static size_t statusbar_pww = (size_t)-1; diff --git a/src/proto.h b/src/proto.h index 7b9eaf59..db397d71 100644 --- a/src/proto.h +++ b/src/proto.h @@ -3,7 +3,7 @@ * proto.h * * * * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -26,8 +26,7 @@ #include "nano.h" -/* All public external variables. See global.c for their - * descriptions. */ +/* All external variables. See global.c for their descriptions. */ #ifndef NANO_TINY extern sigjmp_buf jump_buf; extern bool jump_buf_main; @@ -142,7 +141,7 @@ extern int reverse_attr; extern char *homedir; -/* All public functions in browser.c. */ +/* All functions in browser.c. */ #ifndef DISABLE_BROWSER char *do_browser(char *path, DIR *dir); char *do_browse_from(const char *inpath); @@ -161,7 +160,7 @@ void do_last_file(void); char *striponedir(const char *path); #endif -/* All public functions in chars.c. */ +/* All functions in chars.c. */ #ifdef ENABLE_UTF8 void utf8_init(void); bool using_utf8(void); @@ -243,14 +242,14 @@ bool is_valid_unicode(wchar_t wc); bool is_valid_mbstring(const char *s); #endif -/* All public functions in color.c. */ +/* All functions in color.c. */ #ifdef ENABLE_COLOR void set_colorpairs(void); void color_init(void); void color_update(void); #endif -/* All public functions in cut.c. */ +/* All functions in cut.c. */ void cutbuffer_reset(void); void cut_line(void); #ifndef NANO_TINY @@ -272,7 +271,7 @@ void do_cut_till_end(void); #endif void do_uncut_text(void); -/* All public functions in files.c. */ +/* All functions in files.c. */ void make_new_buffer(void); void initialize_buffer(void); void initialize_buffer_text(void); @@ -340,7 +339,7 @@ bool writehist(FILE *hist, filestruct *histhead); void save_history(void); #endif -/* All public functions in global.c. */ +/* All functions in global.c. */ size_t length_of_list(const shortcut *s); #ifndef NANO_TINY void toggle_init_one(int val @@ -362,7 +361,7 @@ void free_shortcutage(shortcut **shortcutage); void thanks_for_all_the_fish(void); #endif -/* All public functions in help.c. */ +/* All functions in help.c. */ #ifndef DISABLE_HELP void do_help(void (*refresh_func)(void)); void do_help_void(void); @@ -374,7 +373,7 @@ void parse_help_input(int *kbinput, bool *meta_key, bool *func_key); size_t help_line_len(const char *ptr); #endif -/* All public functions in move.c. */ +/* All functions in move.c. */ void do_first_line(void); void do_last_line(void); void do_page_up(void); @@ -418,7 +417,7 @@ void do_scroll_down(void); void do_left(void); void do_right(void); -/* All public functions in nano.c. */ +/* All functions in nano.c. */ filestruct *make_new_node(filestruct *prevnode); filestruct *copy_node(const filestruct *src); void splice_node(filestruct *begin, filestruct *newnode, filestruct @@ -489,7 +488,7 @@ bool do_mouse(void); #endif void do_output(char *output, size_t output_len, bool allow_cntrls); -/* All public functions in prompt.c. */ +/* All functions in prompt.c. */ int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t, bool *ran_func, bool *finished, bool allow_funcs, void (*refresh_func)(void)); @@ -546,7 +545,7 @@ int do_prompt(bool allow_tabs, void do_prompt_abort(void); int do_yesno_prompt(bool all, const char *msg); -/* All public functions in rcfile.c. */ +/* All functions in rcfile.c. */ #ifdef ENABLE_NANORC void rcfile_error(const char *msg, ...); char *parse_next_word(char *ptr); @@ -567,7 +566,7 @@ void parse_rcfile(FILE *rcstream void do_rcfile(void); #endif -/* All public functions in search.c. */ +/* All functions in search.c. */ #ifdef HAVE_REGEX_H int regexp_init(const char *regexp); void regexp_cleanup(void); @@ -623,7 +622,7 @@ char *get_history_completion(filestruct **h, const char *s, size_t len); #endif #endif -/* All public functions in text.c. */ +/* All functions in text.c. */ #ifndef NANO_TINY void do_mark(void); #endif @@ -680,7 +679,7 @@ void do_wordlinechar_count(void); #endif void do_verbatim_input(void); -/* All public functions in utils.c. */ +/* All functions in utils.c. */ int digits(size_t n); void get_homedir(void); bool parse_num(const char *str, ssize_t *val); @@ -728,7 +727,7 @@ void dump_filestruct(const filestruct *inptr); void dump_filestruct_reverse(void); #endif -/* All public functions in winio.c. */ +/* All functions in winio.c. */ void get_key_buffer(WINDOW *win); size_t get_key_buffer_len(void); void unget_input(int *input, size_t input_len); diff --git a/src/rcfile.c b/src/rcfile.c index f01866d3..7aa75d0c 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -3,7 +3,7 @@ * rcfile.c * * * * Copyright (C) 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -97,8 +97,7 @@ static const rcoption rcopts[] = { static bool errors = FALSE; /* Whether we got any errors while parsing an rcfile. */ static size_t lineno = 0; - /* If we did, the line number where the current error - * occurred. */ + /* If we did, the line number where the last error occurred. */ static char *nanorc = NULL; /* The path to the rcfile we're parsing. */ #ifdef ENABLE_COLOR diff --git a/src/search.c b/src/search.c index 435826e4..89b31cf2 100644 --- a/src/search.c +++ b/src/search.c @@ -3,7 +3,7 @@ * search.c * * * * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -977,7 +977,7 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer, if (interactive) { char *ans = mallocstrcpy(NULL, answer); - /* Ask for it. */ + /* Ask for the line and column. */ int i = do_prompt(FALSE, #ifndef DISABLE_TABCOMP TRUE, diff --git a/src/text.c b/src/text.c index 4efb94bc..3604894f 100644 --- a/src/text.c +++ b/src/text.c @@ -3,7 +3,7 @@ * text.c * * * * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -194,8 +194,8 @@ void do_tab(void) /* Indent or unindent the current line (or all lines covered by the mark * if the mark is on) len columns, depending on whether len is positive * or negative. If the TABS_TO_SPACES flag is set, indent/unindent by - * len spaces. Otherwise, indent/unindent by (len / tabsize) tabs and - * (len % tabsize) spaces. */ + * len spaces. Otherwise, indent or unindent by (len / tabsize) tabs + * and (len % tabsize) spaces. */ void do_indent(ssize_t cols) { bool indent_changed = FALSE; diff --git a/src/utils.c b/src/utils.c index d8af75f2..520cc2e5 100644 --- a/src/utils.c +++ b/src/utils.c @@ -3,7 +3,7 @@ * utils.c * * * * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -46,7 +46,7 @@ int digits(size_t n) } /* Return the user's home directory. We use $HOME, and if that fails, - * we fall back on getpwuid(). */ + * we fall back on the home directory of the effective user ID. */ void get_homedir(void) { if (homedir == NULL) { diff --git a/src/winio.c b/src/winio.c index 5b502355..2c67f01b 100644 --- a/src/winio.c +++ b/src/winio.c @@ -3,7 +3,7 @@ * winio.c * * * * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Chris Allegretta * - * Copyright (C) 2005, 2006 David Lawrence Ramsey * + * Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2, or (at your option) * @@ -30,8 +30,8 @@ #include static int *key_buffer = NULL; - /* The keystroke buffer, containing all the keystrokes we have - * at a given point. */ + /* The keystroke buffer, containing all the keystrokes we + * haven't handled yet at a given point. */ static size_t key_buffer_len = 0; /* The length of the keystroke buffer. */ static int statusblank = 0; @@ -3213,7 +3213,7 @@ void do_credits(void) "", "", "(c) 1999, 2000, 2001, 2002, 2003, 2004 Chris Allegretta", - "(c) 2005, 2006 David Lawrence Ramsey", + "(c) 2005, 2006, 2007 David Lawrence Ramsey", "", "", "", -- 2.39.5