X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Futil%2FPreprocessor.java;h=00ae93eddf2435df7cb598e8e7e5857657043762;hb=de378041d5ca2aca1a2b5a31ef15ae90a86c977f;hp=7290e1485f8ffb344af9bf5bbe9b1416b5577383;hpb=faa26089db407989762478bb4f202ffe5a96044b;p=org.ibex.core.git diff --git a/src/org/xwt/util/Preprocessor.java b/src/org/xwt/util/Preprocessor.java index 7290e14..00ae93e 100644 --- a/src/org/xwt/util/Preprocessor.java +++ b/src/org/xwt/util/Preprocessor.java @@ -1,4 +1,10 @@ -// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL] +// Copyright (C) 2003 Adam Megacz all rights reserved. +// +// You may modify, copy, and redistribute this code under the terms of +// the GNU Library Public License version 2.1, with the exception of +// the portion of clause 6a after the semicolon (aka the "obnoxious +// relink clause") + package org.xwt.util; import java.util.*; @@ -148,7 +154,7 @@ PROCESS: } else if (trimmed.startsWith("//#switch")) { int expStart = trimmed.indexOf('(') +1; if (expStart < 1) { err.add(new Error("expected ( in #switch")); continue PROCESS; } - int expEnd = trimmed.indexOf(')'); + int expEnd = trimmed.lastIndexOf(')'); if (expEnd == -1) { err.add(new Error("expected ) in #switch")); continue PROCESS; } if (expEnd - expStart <= 1) { err.add(new Error("badly formed #switch statement")); continue PROCESS; } String expr = trimmed.substring(expStart, expEnd);