diff options
author | Mathias Stearn <mathias@10gen.com> | 2011-09-02 19:14:02 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2011-09-06 12:11:11 -0400 |
commit | 0568f129bd64ac09ca917e6f2718fc215d0e8719 (patch) | |
tree | 347e2ab2049982c5619ccd109973ab3d4102c99b /third_party | |
parent | 210e12a17a04fa27c3fa0ae66cdff2b4e78ba605 (diff) | |
download | mongo-0568f129bd64ac09ca917e6f2718fc215d0e8719.tar.gz |
Revert "fix highlighting in shell for lines longer than console width SERVER-3394"
This reverts commit fb88b80ce4353b7f25914f07210e9f328ae7f922.
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/linenoise/linenoise.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/third_party/linenoise/linenoise.cpp b/third_party/linenoise/linenoise.cpp index dca8dbb5a4f..6a9ed51345f 100644 --- a/third_party/linenoise/linenoise.cpp +++ b/third_party/linenoise/linenoise.cpp @@ -273,9 +273,9 @@ static void refreshLine(int fd, const char *prompt, char *buf, size_t len, size_ if (pos < len) { /* this scans for a brace matching buf[pos] to highlight */ int scanDirection = 0; - if (memchr("}])", buf[pos], len)) + if (strchr("}])", buf[pos])) scanDirection = -1; /* backwards */ - else if (memchr("{[(", buf[pos], len)) + else if (strchr("{[(", buf[pos])) scanDirection = 1; /* forwards */ if (scanDirection) { @@ -283,9 +283,9 @@ static void refreshLine(int fd, const char *prompt, char *buf, size_t len, size_ int i; for(i = pos + scanDirection; i >= 0 && buf[i]; i += scanDirection){ /* TODO: the right thing when inside a string */ - if (memchr("}])", buf[i], len)) + if (strchr("}])", buf[i])) unmatched--; - else if (memchr("{[(", buf[i], len)) + else if (strchr("{[(", buf[i])) unmatched++; if (unmatched == 0) { |