1 /* Line completion stuff for GDB, the GNU debugger.
2 Copyright (C) 2000-2001, 2007-2012 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 #include "expression.h"
23 #include "filenames.h" /* For DOSish file names. */
25 #include "gdb_assert.h"
26 #include "exceptions.h"
28 #include "cli/cli-decode.h"
30 /* FIXME: This is needed because of lookup_cmd_1 (). We should be
31 calling a hook instead so we eliminate the CLI dependency. */
34 /* Needed for rl_completer_word_break_characters() and for
35 rl_filename_completion_function. */
36 #include "readline/readline.h"
38 /* readline defines this. */
41 #include "completer.h"
43 /* Prototypes for local functions. */
45 char *line_completion_function (const char *text
, int matches
,
49 /* readline uses the word breaks for two things:
50 (1) In figuring out where to point the TEXT parameter to the
51 rl_completion_entry_function. Since we don't use TEXT for much,
52 it doesn't matter a lot what the word breaks are for this purpose,
53 but it does affect how much stuff M-? lists.
54 (2) If one of the matches contains a word break character, readline
55 will quote it. That's why we switch between
56 current_language->la_word_break_characters() and
57 gdb_completer_command_word_break_characters. I'm not sure when
58 we need this behavior (perhaps for funky characters in C++
61 /* Variables which are necessary for fancy command line editing. */
63 /* When completing on command names, we remove '-' from the list of
64 word break characters, since we use it in command names. If the
65 readline library sees one in any of the current completion strings,
66 it thinks that the string needs to be quoted and automatically
67 supplies a leading quote. */
68 static char *gdb_completer_command_word_break_characters
=
69 " \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,";
71 /* When completing on file names, we remove from the list of word
72 break characters any characters that are commonly used in file
73 names, such as '-', '+', '~', etc. Otherwise, readline displays
74 incorrect completion candidates. */
75 #ifdef HAVE_DOS_BASED_FILE_SYSTEM
76 /* MS-DOS and MS-Windows use colon as part of the drive spec, and most
77 programs support @foo style response files. */
78 static char *gdb_completer_file_name_break_characters
= " \t\n*|\"';?><@";
80 static char *gdb_completer_file_name_break_characters
= " \t\n*|\"';:?><";
83 /* Characters that can be used to quote completion strings. Note that
84 we can't include '"' because the gdb C parser treats such quoted
85 sequences as strings. */
86 static char *gdb_completer_quote_characters
= "'";
88 /* Accessor for some completer data that may interest other files. */
91 get_gdb_completer_quote_characters (void)
93 return gdb_completer_quote_characters
;
96 /* Line completion interface function for readline. */
99 readline_line_completion_function (const char *text
, int matches
)
101 return line_completion_function (text
, matches
,
102 rl_line_buffer
, rl_point
);
105 /* This can be used for functions which don't want to complete on
106 symbols but don't want to complete on anything else either. */
108 noop_completer (struct cmd_list_element
*ignore
,
109 char *text
, char *prefix
)
114 /* Complete on filenames. */
116 filename_completer (struct cmd_list_element
*ignore
,
117 char *text
, char *word
)
122 int return_val_alloced
;
125 /* Small for testing. */
126 return_val_alloced
= 1;
127 return_val
= (char **) xmalloc (return_val_alloced
* sizeof (char *));
134 p
= rl_filename_completion_function (text
, subsequent_name
);
135 if (return_val_used
>= return_val_alloced
)
137 return_val_alloced
*= 2;
139 (char **) xrealloc (return_val
,
140 return_val_alloced
* sizeof (char *));
144 return_val
[return_val_used
++] = p
;
147 /* We need to set subsequent_name to a non-zero value before the
148 continue line below, because otherwise, if the first file
149 seen by GDB is a backup file whose name ends in a `~', we
150 will loop indefinitely. */
152 /* Like emacs, don't complete on old versions. Especially
153 useful in the "source" command. */
154 if (p
[strlen (p
) - 1] == '~')
161 /* Return exactly p. */
162 return_val
[return_val_used
++] = p
;
163 else if (word
> text
)
165 /* Return some portion of p. */
166 q
= xmalloc (strlen (p
) + 5);
167 strcpy (q
, p
+ (word
- text
));
168 return_val
[return_val_used
++] = q
;
173 /* Return some of TEXT plus p. */
174 q
= xmalloc (strlen (p
) + (text
- word
) + 5);
175 strncpy (q
, word
, text
- word
);
176 q
[text
- word
] = '\0';
178 return_val
[return_val_used
++] = q
;
183 /* There is no way to do this just long enough to affect quote
184 inserting without also affecting the next completion. This
185 should be fixed in readline. FIXME. */
186 /* Ensure that readline does the right thing
187 with respect to inserting quotes. */
188 rl_completer_word_break_characters
= "";
193 /* Complete on locations, which might be of two possible forms:
199 This is intended to be used in commands that set breakpoints
203 location_completer (struct cmd_list_element
*ignore
,
204 char *text
, char *word
)
206 int n_syms
= 0, n_files
= 0;
207 char ** fn_list
= NULL
;
211 int quoted
= *text
== '\'' || *text
== '"';
212 int quote_char
= '\0';
214 char *file_to_match
= NULL
;
215 char *symbol_start
= text
;
216 char *orig_text
= text
;
219 /* Do we have an unquoted colon, as in "break foo.c::bar"? */
220 for (p
= text
; *p
!= '\0'; ++p
)
222 if (*p
== '\\' && p
[1] == '\'')
224 else if (*p
== '\'' || *p
== '"')
228 while (*p
!= '\0' && *p
!= quote_found
)
230 if (*p
== '\\' && p
[1] == quote_found
)
235 if (*p
== quote_found
)
238 break; /* Hit the end of text. */
240 #if HAVE_DOS_BASED_FILE_SYSTEM
241 /* If we have a DOS-style absolute file name at the beginning of
242 TEXT, and the colon after the drive letter is the only colon
243 we found, pretend the colon is not there. */
244 else if (p
< text
+ 3 && *p
== ':' && p
== text
+ 1 + quoted
)
247 else if (*p
== ':' && !colon
)
250 symbol_start
= p
+ 1;
252 else if (strchr (current_language
->la_word_break_characters(), *p
))
253 symbol_start
= p
+ 1;
258 text_len
= strlen (text
);
260 /* Where is the file name? */
265 file_to_match
= (char *) xmalloc (colon
- text
+ 1);
266 strncpy (file_to_match
, text
, colon
- text
+ 1);
267 /* Remove trailing colons and quotes from the file name. */
268 for (s
= file_to_match
+ (colon
- text
);
271 if (*s
== ':' || *s
== quote_char
)
274 /* If the text includes a colon, they want completion only on a
275 symbol name after the colon. Otherwise, we need to complete on
276 symbols as well as on files. */
279 list
= make_file_symbol_completion_list (symbol_start
, word
,
281 xfree (file_to_match
);
285 list
= make_symbol_completion_list (symbol_start
, word
);
286 /* If text includes characters which cannot appear in a file
287 name, they cannot be asking for completion on files. */
289 gdb_completer_file_name_break_characters
) == text_len
)
290 fn_list
= make_source_files_completion_list (text
, text
);
293 /* How many completions do we have in both lists? */
295 for ( ; fn_list
[n_files
]; n_files
++)
298 for ( ; list
[n_syms
]; n_syms
++)
301 /* Make list[] large enough to hold both lists, then catenate
302 fn_list[] onto the end of list[]. */
303 if (n_syms
&& n_files
)
305 list
= xrealloc (list
, (n_syms
+ n_files
+ 1) * sizeof (char *));
306 memcpy (list
+ n_syms
, fn_list
, (n_files
+ 1) * sizeof (char *));
311 /* If we only have file names as possible completion, we should
312 bring them in sync with what rl_complete expects. The
313 problem is that if the user types "break /foo/b TAB", and the
314 possible completions are "/foo/bar" and "/foo/baz"
315 rl_complete expects us to return "bar" and "baz", without the
316 leading directories, as possible completions, because `word'
317 starts at the "b". But we ignore the value of `word' when we
318 call make_source_files_completion_list above (because that
319 would not DTRT when the completion results in both symbols
320 and file names), so make_source_files_completion_list returns
321 the full "/foo/bar" and "/foo/baz" strings. This produces
322 wrong results when, e.g., there's only one possible
323 completion, because rl_complete will prepend "/foo/" to each
324 candidate completion. The loop below removes that leading
326 for (n_files
= 0; fn_list
[n_files
]; n_files
++)
328 memmove (fn_list
[n_files
], fn_list
[n_files
] + (word
- text
),
329 strlen (fn_list
[n_files
]) + 1 - (word
- text
));
331 /* Return just the file-name list as the result. */
336 /* No completions at all. As the final resort, try completing
337 on the entire text as a symbol. */
338 list
= make_symbol_completion_list (orig_text
, word
);
347 /* Helper for expression_completer which recursively counts the number
348 of named fields and methods in a structure or union type. */
350 count_struct_fields (struct type
*type
)
354 CHECK_TYPEDEF (type
);
355 for (i
= 0; i
< TYPE_NFIELDS (type
); ++i
)
357 if (i
< TYPE_N_BASECLASSES (type
))
358 result
+= count_struct_fields (TYPE_BASECLASS (type
, i
));
359 else if (TYPE_FIELD_NAME (type
, i
))
361 if (TYPE_FIELD_NAME (type
, i
)[0] != '\0')
363 else if (TYPE_CODE (TYPE_FIELD_TYPE (type
, i
)) == TYPE_CODE_UNION
)
365 /* Recurse into anonymous unions. */
366 result
+= count_struct_fields (TYPE_FIELD_TYPE (type
, i
));
371 for (i
= TYPE_NFN_FIELDS (type
) - 1; i
>= 0; --i
)
373 if (TYPE_FN_FIELDLIST_NAME (type
, i
))
380 /* Helper for expression_completer which recursively adds field and
381 method names from TYPE, a struct or union type, to the array
382 OUTPUT. This function assumes that OUTPUT is correctly-sized. */
384 add_struct_fields (struct type
*type
, int *nextp
, char **output
,
385 char *fieldname
, int namelen
)
388 int computed_type_name
= 0;
389 char *type_name
= NULL
;
391 CHECK_TYPEDEF (type
);
392 for (i
= 0; i
< TYPE_NFIELDS (type
); ++i
)
394 if (i
< TYPE_N_BASECLASSES (type
))
395 add_struct_fields (TYPE_BASECLASS (type
, i
), nextp
,
396 output
, fieldname
, namelen
);
397 else if (TYPE_FIELD_NAME (type
, i
))
399 if (TYPE_FIELD_NAME (type
, i
)[0] != '\0')
401 if (! strncmp (TYPE_FIELD_NAME (type
, i
),
404 output
[*nextp
] = xstrdup (TYPE_FIELD_NAME (type
, i
));
408 else if (TYPE_CODE (TYPE_FIELD_TYPE (type
, i
)) == TYPE_CODE_UNION
)
410 /* Recurse into anonymous unions. */
411 add_struct_fields (TYPE_FIELD_TYPE (type
, i
), nextp
,
412 output
, fieldname
, namelen
);
417 for (i
= TYPE_NFN_FIELDS (type
) - 1; i
>= 0; --i
)
419 char *name
= TYPE_FN_FIELDLIST_NAME (type
, i
);
421 if (name
&& ! strncmp (name
, fieldname
, namelen
))
423 if (!computed_type_name
)
425 type_name
= type_name_no_tag (type
);
426 computed_type_name
= 1;
428 /* Omit constructors from the completion list. */
429 if (!type_name
|| strcmp (type_name
, name
))
431 output
[*nextp
] = xstrdup (name
);
438 /* Complete on expressions. Often this means completing on symbol
439 names, but some language parsers also have support for completing
442 expression_completer (struct cmd_list_element
*ignore
,
443 char *text
, char *word
)
445 struct type
*type
= NULL
;
447 volatile struct gdb_exception except
;
449 /* Perform a tentative parse of the expression, to see whether a
450 field completion is required. */
452 TRY_CATCH (except
, RETURN_MASK_ERROR
)
454 type
= parse_field_expression (text
, &fieldname
);
456 if (except
.reason
< 0)
458 if (fieldname
&& type
)
462 CHECK_TYPEDEF (type
);
463 if (TYPE_CODE (type
) != TYPE_CODE_PTR
464 && TYPE_CODE (type
) != TYPE_CODE_REF
)
466 type
= TYPE_TARGET_TYPE (type
);
469 if (TYPE_CODE (type
) == TYPE_CODE_UNION
470 || TYPE_CODE (type
) == TYPE_CODE_STRUCT
)
472 int alloc
= count_struct_fields (type
);
473 int flen
= strlen (fieldname
);
475 char **result
= (char **) xmalloc ((alloc
+ 1) * sizeof (char *));
477 add_struct_fields (type
, &out
, result
, fieldname
, flen
);
485 /* Commands which complete on locations want to see the entire
488 p
> text
&& p
[-1] != ' ' && p
[-1] != '\t';
492 /* Not ideal but it is what we used to do before... */
493 return location_completer (ignore
, p
, word
);
496 /* Here are some useful test cases for completion. FIXME: These
497 should be put in the test suite. They should be tested with both
500 "show output-" "radix"
501 "show output" "-radix"
502 "p" ambiguous (commands starting with p--path, print, printf, etc.)
503 "p " ambiguous (all symbols)
504 "info t foo" no completions
505 "info t " no completions
506 "info t" ambiguous ("info target", "info terminal", etc.)
507 "info ajksdlfk" no completions
508 "info ajksdlfk " no completions
510 "info " ambiguous (all info commands)
511 "p \"a" no completions (string constant)
512 "p 'a" ambiguous (all symbols starting with a)
513 "p b-a" ambiguous (all symbols starting with a)
514 "p b-" ambiguous (all symbols)
515 "file Make" "file" (word break hard to screw up here)
516 "file ../gdb.stabs/we" "ird" (needs to not break word at slash)
525 complete_line_internal_reason
;
528 /* Internal function used to handle completions.
531 TEXT is the caller's idea of the "word" we are looking at.
533 LINE_BUFFER is available to be looked at; it contains the entire
534 text of the line. POINT is the offset in that line of the cursor.
535 You should pretend that the line ends at POINT.
537 REASON is of type complete_line_internal_reason.
539 If REASON is handle_brkchars:
540 Preliminary phase, called by gdb_completion_word_break_characters
541 function, is used to determine the correct set of chars that are
542 word delimiters depending on the current command in line_buffer.
543 No completion list should be generated; the return value should be
544 NULL. This is checked by an assertion in that function.
546 If REASON is handle_completions:
547 Main phase, called by complete_line function, is used to get the list
548 of posible completions.
550 If REASON is handle_help:
551 Special case when completing a 'help' command. In this case,
552 once sub-command completions are exhausted, we simply return NULL.
556 complete_line_internal (const char *text
,
557 char *line_buffer
, int point
,
558 complete_line_internal_reason reason
)
561 char *tmp_command
, *p
;
562 /* Pointer within tmp_command which corresponds to text. */
564 struct cmd_list_element
*c
, *result_list
;
566 /* Choose the default set of word break characters to break
567 completions. If we later find out that we are doing completions
568 on command strings (as opposed to strings supplied by the
569 individual command completer functions, which can be any string)
570 then we will switch to the special word break set for command
571 strings, which leaves out the '-' character used in some
573 rl_completer_word_break_characters
=
574 current_language
->la_word_break_characters();
576 /* Decide whether to complete on a list of gdb commands or on
578 tmp_command
= (char *) alloca (point
+ 1);
581 strncpy (tmp_command
, line_buffer
, point
);
582 tmp_command
[point
] = '\0';
583 /* Since text always contains some number of characters leading up
584 to point, we can find the equivalent position in tmp_command
585 by subtracting that many characters from the end of tmp_command. */
586 word
= tmp_command
+ point
- strlen (text
);
590 /* An empty line we want to consider ambiguous; that is, it
591 could be any command. */
592 c
= CMD_LIST_AMBIGUOUS
;
597 c
= lookup_cmd_1 (&p
, cmdlist
, &result_list
, 1);
600 /* Move p up to the next interesting thing. */
601 while (*p
== ' ' || *p
== '\t')
608 /* It is an unrecognized command. So there are no
609 possible completions. */
612 else if (c
== CMD_LIST_AMBIGUOUS
)
616 /* lookup_cmd_1 advances p up to the first ambiguous thing, but
617 doesn't advance over that thing itself. Do so now. */
619 while (*q
&& (isalnum (*q
) || *q
== '-' || *q
== '_'))
621 if (q
!= tmp_command
+ point
)
623 /* There is something beyond the ambiguous
624 command, so there are no possible completions. For
625 example, "info t " or "info t foo" does not complete
626 to anything, because "info t" can be "info target" or
632 /* We're trying to complete on the command which was ambiguous.
633 This we can deal with. */
636 if (reason
!= handle_brkchars
)
637 list
= complete_on_cmdlist (*result_list
->prefixlist
, p
,
642 if (reason
!= handle_brkchars
)
643 list
= complete_on_cmdlist (cmdlist
, p
, word
);
645 /* Ensure that readline does the right thing with respect to
647 rl_completer_word_break_characters
=
648 gdb_completer_command_word_break_characters
;
653 /* We've recognized a full command. */
655 if (p
== tmp_command
+ point
)
657 /* There is no non-whitespace in the line beyond the
660 if (p
[-1] == ' ' || p
[-1] == '\t')
662 /* The command is followed by whitespace; we need to
663 complete on whatever comes after command. */
666 /* It is a prefix command; what comes after it is
667 a subcommand (e.g. "info "). */
668 if (reason
!= handle_brkchars
)
669 list
= complete_on_cmdlist (*c
->prefixlist
, p
, word
);
671 /* Ensure that readline does the right thing
672 with respect to inserting quotes. */
673 rl_completer_word_break_characters
=
674 gdb_completer_command_word_break_characters
;
676 else if (reason
== handle_help
)
680 if (reason
!= handle_brkchars
)
681 list
= complete_on_enum (c
->enums
, p
, word
);
682 rl_completer_word_break_characters
=
683 gdb_completer_command_word_break_characters
;
687 /* It is a normal command; what comes after it is
688 completed by the command's completer function. */
689 if (c
->completer
== filename_completer
)
691 /* Many commands which want to complete on
692 file names accept several file names, as
693 in "run foo bar >>baz". So we don't want
694 to complete the entire text after the
695 command, just the last word. To this
696 end, we need to find the beginning of the
697 file name by starting at `word' and going
701 && strchr (gdb_completer_file_name_break_characters
, p
[-1]) == NULL
;
704 rl_completer_word_break_characters
=
705 gdb_completer_file_name_break_characters
;
707 else if (c
->completer
== location_completer
)
709 /* Commands which complete on locations want to
710 see the entire argument. */
713 && p
[-1] != ' ' && p
[-1] != '\t';
717 if (reason
!= handle_brkchars
&& c
->completer
!= NULL
)
718 list
= (*c
->completer
) (c
, p
, word
);
723 /* The command is not followed by whitespace; we need to
724 complete on the command itself, e.g. "p" which is a
725 command itself but also can complete to "print", "ptype"
729 /* Find the command we are completing on. */
731 while (q
> tmp_command
)
733 if (isalnum (q
[-1]) || q
[-1] == '-' || q
[-1] == '_')
739 if (reason
!= handle_brkchars
)
740 list
= complete_on_cmdlist (result_list
, q
, word
);
742 /* Ensure that readline does the right thing
743 with respect to inserting quotes. */
744 rl_completer_word_break_characters
=
745 gdb_completer_command_word_break_characters
;
748 else if (reason
== handle_help
)
752 /* There is non-whitespace beyond the command. */
754 if (c
->prefixlist
&& !c
->allow_unknown
)
756 /* It is an unrecognized subcommand of a prefix command,
757 e.g. "info adsfkdj". */
762 if (reason
!= handle_brkchars
)
763 list
= complete_on_enum (c
->enums
, p
, word
);
767 /* It is a normal command. */
768 if (c
->completer
== filename_completer
)
770 /* See the commentary above about the specifics
771 of file-name completion. */
774 && strchr (gdb_completer_file_name_break_characters
,
778 rl_completer_word_break_characters
=
779 gdb_completer_file_name_break_characters
;
781 else if (c
->completer
== location_completer
)
785 && p
[-1] != ' ' && p
[-1] != '\t';
789 if (reason
!= handle_brkchars
&& c
->completer
!= NULL
)
790 list
= (*c
->completer
) (c
, p
, word
);
797 /* Generate completions all at once. Returns a NULL-terminated array
798 of strings. Both the array and each element are allocated with
799 xmalloc. It can also return NULL if there are no completions.
801 TEXT is the caller's idea of the "word" we are looking at.
803 LINE_BUFFER is available to be looked at; it contains the entire
806 POINT is the offset in that line of the cursor. You
807 should pretend that the line ends at POINT. */
810 complete_line (const char *text
, char *line_buffer
, int point
)
812 return complete_line_internal (text
, line_buffer
,
813 point
, handle_completions
);
816 /* Complete on command names. Used by "help". */
818 command_completer (struct cmd_list_element
*ignore
,
819 char *text
, char *word
)
821 return complete_line_internal (word
, text
,
822 strlen (text
), handle_help
);
825 /* Get the list of chars that are considered as word breaks
826 for the current command. */
829 gdb_completion_word_break_characters (void)
833 list
= complete_line_internal (rl_line_buffer
, rl_line_buffer
, rl_point
,
835 gdb_assert (list
== NULL
);
836 return rl_completer_word_break_characters
;
839 /* Generate completions one by one for the completer. Each time we
840 are called return another potential completion to the caller.
841 line_completion just completes on commands or passes the buck to
842 the command's completer function, the stuff specific to symbol
843 completion is in make_symbol_completion_list.
845 TEXT is the caller's idea of the "word" we are looking at.
847 MATCHES is the number of matches that have currently been collected
848 from calling this completion function. When zero, then we need to
849 initialize, otherwise the initialization has already taken place
850 and we can just return the next potential completion string.
852 LINE_BUFFER is available to be looked at; it contains the entire
853 text of the line. POINT is the offset in that line of the cursor.
854 You should pretend that the line ends at POINT.
856 Returns NULL if there are no more completions, else a pointer to a
857 string which is a possible completion, it is the caller's
858 responsibility to free the string. */
861 line_completion_function (const char *text
, int matches
,
862 char *line_buffer
, int point
)
864 static char **list
= (char **) NULL
; /* Cache of completions. */
865 static int index
; /* Next cached completion. */
870 /* The caller is beginning to accumulate a new set of
871 completions, so we need to find all of them now, and cache
872 them for returning one at a time on future calls. */
876 /* Free the storage used by LIST, but not by the strings
877 inside. This is because rl_complete_internal () frees
878 the strings. As complete_line may abort by calling
879 `error' clear LIST now. */
884 list
= complete_line (text
, line_buffer
, point
);
887 /* If we found a list of potential completions during initialization
888 then dole them out one at a time. The vector of completions is
889 NULL terminated, so after returning the last one, return NULL
890 (and continue to do so) each time we are called after that, until
891 a new list is available. */
895 output
= list
[index
];
903 /* Can't do this because readline hasn't yet checked the word breaks
904 for figuring out whether to insert a quote. */
906 /* Make sure the word break characters are set back to normal for
907 the next time that readline tries to complete something. */
908 rl_completer_word_break_characters
=
909 current_language
->la_word_break_characters();
915 /* Skip over the possibly quoted word STR (as defined by the quote
916 characters QUOTECHARS and the word break characters BREAKCHARS).
917 Returns pointer to the location after the "word". If either
918 QUOTECHARS or BREAKCHARS is NULL, use the same values used by the
922 skip_quoted_chars (char *str
, char *quotechars
, char *breakchars
)
924 char quote_char
= '\0';
927 if (quotechars
== NULL
)
928 quotechars
= gdb_completer_quote_characters
;
930 if (breakchars
== NULL
)
931 breakchars
= current_language
->la_word_break_characters();
933 for (scan
= str
; *scan
!= '\0'; scan
++)
935 if (quote_char
!= '\0')
937 /* Ignore everything until the matching close quote char. */
938 if (*scan
== quote_char
)
940 /* Found matching close quote. */
945 else if (strchr (quotechars
, *scan
))
947 /* Found start of a quoted string. */
950 else if (strchr (breakchars
, *scan
))
959 /* Skip over the possibly quoted word STR (as defined by the quote
960 characters and word break characters used by the completer).
961 Returns pointer to the location after the "word". */
964 skip_quoted (char *str
)
966 return skip_quoted_chars (str
, NULL
, NULL
);