summaryrefslogtreecommitdiff
path: root/libjava/java/text
diff options
context:
space:
mode:
authorziga <ziga@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-08 15:46:08 +0000
committerziga <ziga@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-08 15:46:08 +0000
commit29890538394d9a6c63346a404dd90c4f5f0256ed (patch)
treede06061bbe96bf2f6161d3324053a1ea68548502 /libjava/java/text
parentbafbe9351f02e858b62dc506b9c585ece370662c (diff)
downloadgcc-29890538394d9a6c63346a404dd90c4f5f0256ed.tar.gz
2005-06-08 Ziga Mahkovec <ziga.mahkovec@klika.si>
* java/text/MessageFormat.java (parse): When parsing strings, check for an empty pattern trailer. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100761 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/text')
-rw-r--r--libjava/java/text/MessageFormat.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/libjava/java/text/MessageFormat.java b/libjava/java/text/MessageFormat.java
index 4a24afd1f44..8d53ec21ec1 100644
--- a/libjava/java/text/MessageFormat.java
+++ b/libjava/java/text/MessageFormat.java
@@ -658,7 +658,11 @@ public class MessageFormat extends Format
{
// We have a String format. This can lose in a number
// of ways, but we give it a shot.
- int next_index = sourceStr.indexOf(elements[i].trailer, index);
+ int next_index;
+ if (elements[i].trailer.length() > 0)
+ next_index = sourceStr.indexOf(elements[i].trailer, index);
+ else
+ next_index = sourceStr.length();
if (next_index == -1)
{
pos.setErrorIndex(index);