diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-11-19 10:09:42 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-11-19 10:09:42 +0000 |
commit | b3ff61f8155f296633f96206c926b545b97053b3 (patch) | |
tree | a6760548fc436f2858e65e5d8af8aa1e583e46ee /gdb/printcmd.c | |
parent | 6266b411ce94c94c7fe584a78cdb67246ea4d771 (diff) | |
download | gdb-b3ff61f8155f296633f96206c926b545b97053b3.zip gdb-b3ff61f8155f296633f96206c926b545b97053b3.tar.gz gdb-b3ff61f8155f296633f96206c926b545b97053b3.tar.bz2 |
gdb: make use of skip_to_space and skip_spaces
Some late feedback on this commit:
commit 037d7135de575c9e0c20e9158c105979bfee339c
Date: Mon Nov 16 11:36:56 2020 +0000
gdb: improve command completion for 'print', 'x', and 'display'
Suggested making use of the skip_to_space and skip_spaces helper
functions. There should be no user visible changes after this commit.
gdb/ChangeLog:
* printcmd.c (skip_over_slash_fmt): Make use of skip_to_space and
skip_spaces.
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r-- | gdb/printcmd.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 8c05ac8..a9c64b9 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -1261,8 +1261,7 @@ skip_over_slash_fmt (completion_tracker &tracker, const char **args) if (ISALNUM (text[1]) || ISSPACE (text[1])) { /* Skip over the actual format specification. */ - while (*text != '\0' && !ISSPACE (*text)) - ++text; + text = skip_to_space (text); if (*text == '\0') { @@ -1272,8 +1271,7 @@ skip_over_slash_fmt (completion_tracker &tracker, const char **args) else { in_fmt = false; - while (ISSPACE (*text)) - ++text; + text = skip_spaces (text); } } else if (text[1] == '\0') |