diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-26 18:15:19 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-27 17:46:42 +0000 |
| commit | 7e045c3d4285e01a8f8b13dc7ef5034f5eafcce1 (patch) | |
| tree | 8a52ba1c407c44416e7b13bf7699b9411176d8cb /lib/command.c | |
| parent | 5ce1d8b118ae85765d135aaf06bf04a554607d12 (diff) | |
*: use ->text and strmatch where appropriate
Still need to go fix all the places where we do a 1-char strncmp...
spatch follows
------------------
@asdf@
expression idx;
@@
<...
strcmp (
- argv[idx]->arg,
+ argv[idx]->text,
...)
...>
@depends on asdf@
expression idx;
@@
<...
- !strcmp (argv[idx]->text,
+ strmatch (argv[idx]->text,
...)
...>
@depends on asdf@
expression idx;
expression arg;
@@
<...
- strcmp (argv[idx]->text, arg) == 0
+ strmatch (argv[idx]->text, arg)
...>
@depends on asdf@
expression idx;
expression arg;
@@
<...
- strcmp (argv[idx]->text, arg) != 0
+ !strmatch (argv[idx]->text, arg)
...>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/command.c')
| -rw-r--r-- | lib/command.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/command.c b/lib/command.c index 5853710999..b69aeacd63 100644 --- a/lib/command.c +++ b/lib/command.c @@ -1534,8 +1534,8 @@ DEFUN (config_write, struct stat conf_stat; // if command was 'write terminal' or 'show running-config' - if (argc == 2 && (!strcmp(argv[idx_type]->text, "terminal") || - !strcmp(argv[0]->text, "show"))) + if (argc == 2 && (strmatch(argv[idx_type]->text, "terminal") || + strmatch(argv[0]->text, "show"))) { vty_write_config (vty); return CMD_SUCCESS; |
