Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1013)

Unified Diff: src/d8-readline.cc

Issue 13093: Fixed d8 on leopard. (Closed)
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/platform.h » ('j') | src/platform-macos.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8-readline.cc
diff --git a/src/d8-readline.cc b/src/d8-readline.cc
index 4cfee8b73aa484c1f3fb9f6654177a45151406be..d43d3ce2499f1263789d93461c3a433777472013 100644
--- a/src/d8-readline.cc
+++ b/src/d8-readline.cc
@@ -26,6 +26,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#include <cstdio>
#include <readline/readline.h>
#include <readline/history.h>
@@ -33,6 +34,11 @@
#include "d8.h"
+#if RL_READLINE_VERSION >= 0x0500
Erik Corry 2008/12/03 13:43:22 I think this deserves a comment.
+#define completion_matches rl_completion_matches
+#endif
+
+
namespace v8 {
@@ -85,7 +91,7 @@ void ReadLineEditor::AddHistory(const char* str) {
char** ReadLineEditor::AttemptedCompletion(const char* text,
int start,
int end) {
- char** result = rl_completion_matches(text, CompletionGenerator);
+ char** result = completion_matches(text, CompletionGenerator);
rl_attempted_completion_over = true;
return result;
}
@@ -95,7 +101,7 @@ char* ReadLineEditor::CompletionGenerator(const char* text, int state) {
static unsigned current_index;
static Persistent<Array> current_completions;
if (state == 0) {
- i::SmartPointer<char> full_text(strndup(rl_line_buffer, rl_point));
+ i::SmartPointer<char> full_text(i::OS::StrNDup(rl_line_buffer, rl_point));
HandleScope scope;
Handle<Array> completions =
Shell::GetCompletions(String::New(text), String::New(*full_text));
« no previous file with comments | « no previous file | src/platform.h » ('j') | src/platform-macos.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698