Menu

#1 exact completion type does not work as expected

open
nobody
None
5
2004-10-13
2004-10-13
Anonymous
No

sqsh_readline.c uses strncasecmp even if the exact
completion type is selected. The patch below provides
the expected behaviour.

--- sqsh_readline.c~ 2004-04-07 14:35:03.000000000 +0200
+++ sqsh_readline.c 2004-10-13 10:17:39.000000000 +0200
@@ -762,11 +762,20 @@
/*
* Traverse on through the list
until we find another
* match or reach the end of
the list.
- */
- for (cur = cur->k_nxt;
- cur != NULL &&
strncasecmp( cur->k_word, text, len ) != 0;
- cur = cur->k_nxt );
-
+ */
+ if (*keyword_completion == '4')
/* Exact */
+ {
+ for (cur = cur->k_nxt;
+ cur != NULL && strncmp(
cur->k_word, text, len ) != 0;
+ cur = cur->k_nxt );
+ }
+ else
+ {
+ for (cur = cur->k_nxt;
+ cur != NULL && strncasecmp(
cur->k_word, text, len ) != 0;
+ cur = cur->k_nxt );
+ }
+
/*
* If we hit the end, then we
let the caller know that
* we are all done.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.