Skip to content

Commit 48231a4

Browse files
author
Rob Sanders
committed
Revert fixes from PR82 for tab completion - needs more work
1 parent 6194f26 commit 48231a4

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

libcli.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3127,17 +3127,17 @@ int cli_int_execute_pipeline(struct cli_def *cli, struct cli_pipeline *pipeline)
31273127
* Attempt quick dirty wrapping of helptext taking into account the offset from name, embedded
31283128
* cr/lf in helptext, and trying to split on last white-text before the right margin. If there is
31293129
* no identifiable whitespace to split on, then the split will be done on the last character to fit
3130-
* that line (currently max line with is 80 characters).
3131-
* The firstcolumn width will be a greater of 22 characters or the width of nameptr, which ever is
3130+
* that line (currently max line with is 80 characters).
3131+
* The firstcolumn width will be a greater of 22 characters or the width of nameptr, which ever is
31323132
* greater, and will be offset from the rest of the line by one space. However, if nameptr is
31333133
* greater than 22 characters it will be put on a line by itself. The first column will be formatted
31343134
* as spaces (22 of em) for all subsequent lines.
31353135
.
31363136
* This routine assumes any 'indenting' of the nameptr field has already been done, and is solely
3137-
* concerned about wrapping the combination of nameptr and helpptr to look 'nice'.
3137+
* concerned about wrapping the combination of nameptr and helpptr to look 'nice'.
31383138
*/
3139-
3140-
#define MAX(a,b) ((a) >(b) ? (a) : (b))
3139+
3140+
#define MAX(a, b) ((a) > (b) ? (a) : (b))
31413141
#define MAXWIDTHCOL1 22
31423142

31433143
void cli_int_wrap_help_line(char *nameptr, char *helpptr, struct cli_comphelp *comphelp) {
@@ -3164,8 +3164,8 @@ void cli_int_wrap_help_line(char *nameptr, char *helpptr, struct cli_comphelp *c
31643164
nameptr = emptystring;
31653165
namewidth = MAXWIDTHCOL1;
31663166
}
3167-
namewidth = MAX(MAXWIDTHCOL1,strlen(nameptr));
3168-
availwidth = maxwidth - namewidth -1; // subtract 1 for space separating col1 from rest of line
3167+
namewidth = MAX(MAXWIDTHCOL1, strlen(nameptr));
3168+
availwidth = maxwidth - namewidth - 1; // subtract 1 for space separating col1 from rest of line
31693169
toprint = strlen(helpptr);
31703170
if (toprint > availwidth) {
31713171
toprint = availwidth;

libcli.spec

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ rm -rf $RPM_BUILD_ROOT
7575
- applied fixes for misspellings on LIBCLI version #defines (issue #75) - fix provided on github by belge-sel on 19Sep2021
7676
- Fix for printing (issue #79) where text left in buffer (from call to cli_bufprint for example) is discarded instead of preserved. Code provided on github by JereLeppanen on 27Apr2021
7777

78-
* Tue Nov 29 2022 Rob Sanders <rsanders@forcepointgov.com> 1.10.8
79-
- Fix for issue #82 (OPTIONAL_FLAG tab completion not honoring user provided callback)
80-
8178
* Wed Nov 16 2022 Rob Sanders <rsanders@forcepointgov.com> 1.10.8
8279
- Doxygen headers for libli.c routines - code provided on github by mpzanoosi on 14May2021
8380

@@ -255,7 +252,7 @@ rm -rf $RPM_BUILD_ROOT
255252
- Disable TAB completion during username entry
256253

257254
* Fri May 2 2008 David Parrish <david@dparrish.com> 1.9.2-1
258-
- Add configurable timeout for cl7i_regular() - defaults to 1 second
255+
- Add configurable timeout for cli_regular() - defaults to 1 second
259256
- Add idle timeout support
260257

261258
* Thu Jul 5 2007 Brendan O'Dea <bod@optus.net> 1.9.1-1

0 commit comments

Comments
 (0)