From 0a0acdcf76c6edd41ad71405c1b97026054b4065 Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Sat, 13 May 2000 02:14:52 +0000 Subject: [PATCH] fix for linux bustage --- js/js2/parser.cpp | 8 +++----- js2/src/parser.cpp | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/js/js2/parser.cpp b/js/js2/parser.cpp index 59f45deb013..379f477f832 100644 --- a/js/js2/parser.cpp +++ b/js/js2/parser.cpp @@ -33,12 +33,10 @@ namespace JS = JavaScript; // sourceLocation describes the origin of the source and may be used for error messages. // initialLineNum is the line number of the first line of the source string. JS::Reader::Reader(const String &source, const String &sourceLocation, uint32 initialLineNum): - source(source), sourceLocation(sourceLocation), initialLineNum(initialLineNum) + source(source + uni::null), sourceLocation(sourceLocation), initialLineNum(initialLineNum) { - const char16 *b = Reader::source.c_str(); - begin = b; - p = b; - end = b + Reader::source.size(); + begin = p = this->source.data(); + end = begin + this->source.size() - 1; #ifdef DEBUG recordString = 0; #endif diff --git a/js2/src/parser.cpp b/js2/src/parser.cpp index 59f45deb013..379f477f832 100644 --- a/js2/src/parser.cpp +++ b/js2/src/parser.cpp @@ -33,12 +33,10 @@ namespace JS = JavaScript; // sourceLocation describes the origin of the source and may be used for error messages. // initialLineNum is the line number of the first line of the source string. JS::Reader::Reader(const String &source, const String &sourceLocation, uint32 initialLineNum): - source(source), sourceLocation(sourceLocation), initialLineNum(initialLineNum) + source(source + uni::null), sourceLocation(sourceLocation), initialLineNum(initialLineNum) { - const char16 *b = Reader::source.c_str(); - begin = b; - p = b; - end = b + Reader::source.size(); + begin = p = this->source.data(); + end = begin + this->source.size() - 1; #ifdef DEBUG recordString = 0; #endif