Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [OB] whitespace cleanup, completer.c
@ 2007-08-10 20:45 msnyder
  2007-08-11  9:42 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: msnyder @ 2007-08-10 20:45 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 37 bytes --]

Spaces, caps, that sort of thing...


[-- Attachment #2: ws.txt --]
[-- Type: text/plain, Size: 8424 bytes --]

2007-08-10  Michael Snyder  <msnyder@access-company.com>

	* completer.c: Comment/whitespace cleanup.

Index: completer.c
===================================================================
RCS file: /cvs/src/src/gdb/completer.c,v
retrieving revision 1.18
diff -p -r1.18 completer.c
*** completer.c	9 Jan 2007 17:58:50 -0000	1.18
--- completer.c	10 Aug 2007 20:34:37 -0000
***************
*** 22,28 ****
  #include "symtab.h"
  #include "gdbtypes.h"
  #include "expression.h"
! #include "filenames.h"		/* for DOSish file names */
  #include "language.h"
  
  #include "cli/cli-decode.h"
--- 22,28 ----
  #include "symtab.h"
  #include "gdbtypes.h"
  #include "expression.h"
! #include "filenames.h"		/* For DOSish file names.  */
  #include "language.h"
  
  #include "cli/cli-decode.h"
***************
*** 40,46 ****
  
  #include "completer.h"
  
! /* Prototypes for local functions */
  static
  char *line_completion_function (const char *text, int matches, 
  				char *line_buffer,
--- 40,46 ----
  
  #include "completer.h"
  
! /* Prototypes for local functions.  */
  static
  char *line_completion_function (const char *text, int matches, 
  				char *line_buffer,
*************** char *line_completion_function (const ch
*** 63,69 ****
     word break characters, since we use it in command names.  If the
     readline library sees one in any of the current completion strings,
     it thinks that the string needs to be quoted and automatically supplies
!    a leading quote. */
  static char *gdb_completer_command_word_break_characters =
  " \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,";
  
--- 63,69 ----
     word break characters, since we use it in command names.  If the
     readline library sees one in any of the current completion strings,
     it thinks that the string needs to be quoted and automatically supplies
!    a leading quote.  */
  static char *gdb_completer_command_word_break_characters =
  " \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,";
  
*************** static char *gdb_completer_loc_break_cha
*** 85,94 ****
  
  /* Characters that can be used to quote completion strings.  Note that we
     can't include '"' because the gdb C parser treats such quoted sequences
!    as strings. */
  static char *gdb_completer_quote_characters = "'";
  \f
! /* Accessor for some completer data that may interest other files. */
  
  char *
  get_gdb_completer_quote_characters (void)
--- 85,94 ----
  
  /* Characters that can be used to quote completion strings.  Note that we
     can't include '"' because the gdb C parser treats such quoted sequences
!    as strings.  */
  static char *gdb_completer_quote_characters = "'";
  \f
! /* Accessor for some completer data that may interest other files.  */
  
  char *
  get_gdb_completer_quote_characters (void)
*************** location_completer (char *text, char *wo
*** 231,237 ****
  	  if (*p == quote_found)
  	    quote_found = 0;
  	  else
! 	    break;		/* hit the end of text */
  	}
  #if HAVE_DOS_BASED_FILE_SYSTEM
        /* If we have a DOS-style absolute file name at the beginning of
--- 231,237 ----
  	  if (*p == quote_found)
  	    quote_found = 0;
  	  else
! 	    break;		/* Hit the end of text.  */
  	}
  #if HAVE_DOS_BASED_FILE_SYSTEM
        /* If we have a DOS-style absolute file name at the beginning of
*************** complete_line (const char *text, char *l
*** 395,401 ****
    rl_completer_word_break_characters =
      current_language->la_word_break_characters();
  
!       /* Decide whether to complete on a list of gdb commands or on symbols. */
    tmp_command = (char *) alloca (point + 1);
    p = tmp_command;
  
--- 395,401 ----
    rl_completer_word_break_characters =
      current_language->la_word_break_characters();
  
!   /* Decide whether to complete on a list of gdb commands or on symbols. */
    tmp_command = (char *) alloca (point + 1);
    p = tmp_command;
  
*************** complete_line (const char *text, char *l
*** 486,492 ****
  		  list = complete_on_cmdlist (*c->prefixlist, p, word);
  
  		  /* Insure that readline does the right thing
! 		         with respect to inserting quotes.  */
  		  rl_completer_word_break_characters =
  		    gdb_completer_command_word_break_characters;
  		}
--- 486,492 ----
  		  list = complete_on_cmdlist (*c->prefixlist, p, word);
  
  		  /* Insure that readline does the right thing
! 		     with respect to inserting quotes.  */
  		  rl_completer_word_break_characters =
  		    gdb_completer_command_word_break_characters;
  		}
*************** complete_line (const char *text, char *l
*** 551,558 ****
  
  	      list = complete_on_cmdlist (result_list, q, word);
  
! 		  /* Insure that readline does the right thing
! 		     with respect to inserting quotes.  */
  	      rl_completer_word_break_characters =
  		gdb_completer_command_word_break_characters;
  	    }
--- 551,558 ----
  
  	      list = complete_on_cmdlist (result_list, q, word);
  
! 	      /* Insure that readline does the right thing
! 		 with respect to inserting quotes.  */
  	      rl_completer_word_break_characters =
  		gdb_completer_command_word_break_characters;
  	    }
*************** complete_line (const char *text, char *l
*** 624,645 ****
     free the string.  */
  
  static char *
! line_completion_function (const char *text, int matches, char *line_buffer, int point)
  {
!   static char **list = (char **) NULL;	/* Cache of completions */
!   static int index;		/* Next cached completion */
    char *output = NULL;
  
    if (matches == 0)
      {
        /* The caller is beginning to accumulate a new set of completions, so
           we need to find all of them now, and cache them for returning one at
!          a time on future calls. */
  
        if (list)
  	{
  	  /* Free the storage used by LIST, but not by the strings inside.
! 	     This is because rl_complete_internal () frees the strings. */
  	  xfree (list);
  	}
        index = 0;
--- 624,646 ----
     free the string.  */
  
  static char *
! line_completion_function (const char *text, int matches, 
! 			  char *line_buffer, int point)
  {
!   static char **list = (char **) NULL;	/* Cache of completions.  */
!   static int index;			/* Next cached completion.  */
    char *output = NULL;
  
    if (matches == 0)
      {
        /* The caller is beginning to accumulate a new set of completions, so
           we need to find all of them now, and cache them for returning one at
!          a time on future calls.  */
  
        if (list)
  	{
  	  /* Free the storage used by LIST, but not by the strings inside.
! 	     This is because rl_complete_internal () frees the strings.  */
  	  xfree (list);
  	}
        index = 0;
*************** line_completion_function (const char *te
*** 650,656 ****
       dole them out one at a time.  The vector of completions is NULL
       terminated, so after returning the last one, return NULL (and continue
       to do so) each time we are called after that, until a new list is
!      available. */
  
    if (list)
      {
--- 651,657 ----
       dole them out one at a time.  The vector of completions is NULL
       terminated, so after returning the last one, return NULL (and continue
       to do so) each time we are called after that, until a new list is
!      available.  */
  
    if (list)
      {
*************** skip_quoted_chars (char *str, char *quot
*** 696,705 ****
      {
        if (quote_char != '\0')
  	{
! 	  /* Ignore everything until the matching close quote char */
  	  if (*scan == quote_char)
  	    {
! 	      /* Found matching close quote. */
  	      scan++;
  	      break;
  	    }
--- 697,706 ----
      {
        if (quote_char != '\0')
  	{
! 	  /* Ignore everything until the matching close quote char.  */
  	  if (*scan == quote_char)
  	    {
! 	      /* Found matching close quote.  */
  	      scan++;
  	      break;
  	    }
*************** skip_quoted_chars (char *str, char *quot
*** 720,726 ****
  
  /* Skip over the possibly quoted word STR (as defined by the quote
     characters and word break characters used by the completer).
!    Returns pointer to the location after the "word". */
  
  char *
  skip_quoted (char *str)
--- 721,727 ----
  
  /* Skip over the possibly quoted word STR (as defined by the quote
     characters and word break characters used by the completer).
!    Returns pointer to the location after the "word".  */
  
  char *
  skip_quoted (char *str)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OB] whitespace cleanup, completer.c
  2007-08-10 20:45 [OB] whitespace cleanup, completer.c msnyder
@ 2007-08-11  9:42 ` Eli Zaretskii
  2007-08-11 20:09   ` msnyder
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2007-08-11  9:42 UTC (permalink / raw)
  To: msnyder; +Cc: gdb-patches

> Date: Fri, 10 Aug 2007 13:45:18 -0700 (PDT)
> From: msnyder@sonic.net
> 
> Spaces, caps, that sort of thing...

Thanks.

> ! 	      /* Insure that readline does the right thing
                 ^^^^^^
Actually, this should be "Ensure".


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OB] whitespace cleanup, completer.c
  2007-08-11  9:42 ` Eli Zaretskii
@ 2007-08-11 20:09   ` msnyder
  0 siblings, 0 replies; 3+ messages in thread
From: msnyder @ 2007-08-11 20:09 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: msnyder, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 309 bytes --]

>> Date: Fri, 10 Aug 2007 13:45:18 -0700 (PDT)
>> From: msnyder@sonic.net
>>
>> Spaces, caps, that sort of thing...
>
> Thanks.
>
>> ! 	      /* Insure that readline does the right thing
>                  ^^^^^^
> Actually, this should be "Ensure".

Okey dokey (four times, no less!)
Committed as attached.


[-- Attachment #2: ensure.txt --]
[-- Type: text/plain, Size: 3037 bytes --]

2007-08-11  Michael Snyder  <msnyder@access-company.com>

	* completer.c: Spelling fix in comments.

Index: completer.c
===================================================================
RCS file: /cvs/src/src/gdb/completer.c,v
retrieving revision 1.19
diff -p -r1.19 completer.c
*** completer.c	10 Aug 2007 20:35:09 -0000	1.19
--- completer.c	11 Aug 2007 20:07:29 -0000
*************** filename_completer (char *text, char *wo
*** 182,188 ****
    /* There is no way to do this just long enough to affect quote inserting
       without also affecting the next completion.  This should be fixed in
       readline.  FIXME.  */
!   /* Insure that readline does the right thing
       with respect to inserting quotes.  */
    rl_completer_word_break_characters = "";
  #endif
--- 182,188 ----
    /* There is no way to do this just long enough to affect quote inserting
       without also affecting the next completion.  This should be fixed in
       readline.  FIXME.  */
!   /* Ensure that readline does the right thing
       with respect to inserting quotes.  */
    rl_completer_word_break_characters = "";
  #endif
*************** complete_line (const char *text, char *l
*** 461,467 ****
  	    {
  	      list = complete_on_cmdlist (cmdlist, p, word);
  	    }
! 	  /* Insure that readline does the right thing with respect to
  	     inserting quotes.  */
  	  rl_completer_word_break_characters =
  	    gdb_completer_command_word_break_characters;
--- 461,467 ----
  	    {
  	      list = complete_on_cmdlist (cmdlist, p, word);
  	    }
! 	  /* Ensure that readline does the right thing with respect to
  	     inserting quotes.  */
  	  rl_completer_word_break_characters =
  	    gdb_completer_command_word_break_characters;
*************** complete_line (const char *text, char *l
*** 485,491 ****
  		     a subcommand (e.g. "info ").  */
  		  list = complete_on_cmdlist (*c->prefixlist, p, word);
  
! 		  /* Insure that readline does the right thing
  		     with respect to inserting quotes.  */
  		  rl_completer_word_break_characters =
  		    gdb_completer_command_word_break_characters;
--- 485,491 ----
  		     a subcommand (e.g. "info ").  */
  		  list = complete_on_cmdlist (*c->prefixlist, p, word);
  
! 		  /* Ensure that readline does the right thing
  		     with respect to inserting quotes.  */
  		  rl_completer_word_break_characters =
  		    gdb_completer_command_word_break_characters;
*************** complete_line (const char *text, char *l
*** 551,557 ****
  
  	      list = complete_on_cmdlist (result_list, q, word);
  
! 	      /* Insure that readline does the right thing
  		 with respect to inserting quotes.  */
  	      rl_completer_word_break_characters =
  		gdb_completer_command_word_break_characters;
--- 551,557 ----
  
  	      list = complete_on_cmdlist (result_list, q, word);
  
! 	      /* Ensure that readline does the right thing
  		 with respect to inserting quotes.  */
  	      rl_completer_word_break_characters =
  		gdb_completer_command_word_break_characters;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-11 20:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-10 20:45 [OB] whitespace cleanup, completer.c msnyder
2007-08-11  9:42 ` Eli Zaretskii
2007-08-11 20:09   ` msnyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox