On Mon, Jul 30, 2007 at 06:38:47PM +0200, Georg Baum wrote:
> [EMAIL PROTECTED] wrote:
>
> > + // This facet has been adapted from the STLPort library
>
> That means that this part of the code is under the STLPort license.
> The STLPort license is not GPL, so you either have to add additional license
> information or revert this commit, depending on whether the STLPort license
> is compatible with the GPL or not.
I will not do neither of what you suggest. I will simply replace
that portion of code with other code adapted from the Forestieri
library as shown in the attached patch.
Thanks for having taken the time to check these license issues.
--
Enrico
Index: src/support/docstring.cpp
===================================================================
--- src/support/docstring.cpp (revision 19233)
+++ src/support/docstring.cpp (working copy)
@@ -13,6 +13,7 @@
#include "docstring.h"
#include "qstring_helpers.h"
#include "unicode.h"
+#include "lstrings.h"
#include <locale>
#include <iostream>
@@ -572,34 +573,35 @@ protected:
do_get(iter_type iit, iter_type eit, std::ios_base & b,
std::ios_base::iostate & err, bool & v) const
{
- // This facet has been adapted from the STLPort library
if (b.flags() & std::ios_base::boolalpha) {
numpunct_facet p;
lyx::docstring const truename =
from_local8bit(p.truename());
lyx::docstring const falsename =
from_local8bit(p.falsename());
- bool true_ok = true;
- bool false_ok = true;
+ lyx::docstring s;
+ s.resize(16);
+ bool ok = true;
size_t n = 0;
+ size_t const tsize = truename.size();
+ size_t const fsize = falsename.size();
for (; iit != eit; ++iit) {
- lyx::char_type c = *iit;
- true_ok = true_ok && (c == truename[n]);
- false_ok = false_ok && (c == falsename[n]);
+ s += *iit;
++n;
- if ((!true_ok && !false_ok) ||
- (true_ok && n >= truename.size()) ||
- (false_ok && n >= falsename.size())) {
+ bool true_ok = lyx::support::prefixIs(truename,
s);
+ bool false_ok =
lyx::support::prefixIs(falsename, s);
+ if (!true_ok && !false_ok) {
+ ++iit;
+ ok = false;
+ break;
+ }
+ if ((true_ok && n == tsize) ||
+ (false_ok && n == fsize)) {
++iit;
break;
}
}
- if (true_ok && n < truename.size())
- true_ok = false;
- if (false_ok && n < falsename.size())
- false_ok = false;
- if (true_ok || false_ok) {
- err = std::ios_base::goodbit;
- v = true_ok;
- } else
+ if (ok)
+ v = truename == s ? true : false;
+ else
err = std::ios_base::failbit;
if (iit == eit)
err |= std::ios_base::eofbit;