d017c73508
tstring bug-fix: 171957) :operator[] and in String::operator+=. (BUG:169389)
85 lines
2.6 KiB
Diff
85 lines
2.6 KiB
Diff
diff -Nur taglib-1.5/taglib/toolkit/tbytevector.cpp taglib/taglib/toolkit/tbytevector.cpp
|
|
--- taglib-1.5/taglib/toolkit/tbytevector.cpp 2008-02-12 04:18:52.000000000 +0100
|
|
+++ taglib/taglib/toolkit/tbytevector.cpp 2008-12-04 13:37:36.000000000 +0100
|
|
@@ -147,12 +147,12 @@
|
|
public:
|
|
ByteVectorMirror(const ByteVector &source) : v(source) {}
|
|
|
|
- const char operator[](int index) const
|
|
+ char operator[](int index) const
|
|
{
|
|
return v[v.size() - index - 1];
|
|
}
|
|
|
|
- const char at(int index) const
|
|
+ char at(int index) const
|
|
{
|
|
return v.at(v.size() - index - 1);
|
|
}
|
|
diff -Nur taglib-1.5/taglib/toolkit/tbytevector.h taglib/taglib/toolkit/tbytevector.h
|
|
--- taglib-1.5/taglib/toolkit/tbytevector.h 2008-02-05 19:51:48.000000000 +0100
|
|
+++ taglib/taglib/toolkit/tbytevector.h 2009-07-02 22:54:32.000000000 +0200
|
|
@@ -30,7 +30,7 @@
|
|
#include "taglib_export.h"
|
|
|
|
#include <vector>
|
|
-#include <ostream>
|
|
+#include <iostream>
|
|
|
|
namespace TagLib {
|
|
|
|
diff -Nur taglib-1.5/taglib/toolkit/tbytevectorlist.cpp taglib/taglib/toolkit/tbytevectorlist.cpp
|
|
--- taglib-1.5/taglib/toolkit/tbytevectorlist.cpp 2008-02-04 16:14:45.000000000 +0100
|
|
+++ taglib/taglib/toolkit/tbytevectorlist.cpp 2009-07-11 15:24:21.000000000 +0200
|
|
@@ -52,7 +52,7 @@
|
|
offset != -1 && (max == 0 || max > int(l.size()) + 1);
|
|
offset = v.find(pattern, offset + pattern.size(), byteAlign))
|
|
{
|
|
- if(offset - previousOffset > 1)
|
|
+ if(offset - previousOffset >= 1)
|
|
l.append(v.mid(previousOffset, offset - previousOffset));
|
|
else
|
|
l.append(ByteVector::null);
|
|
diff -Nur taglib-1.5-orig/taglib/toolkit/tstring.cpp taglib-1.5/taglib/toolkit/tstring.cpp
|
|
--- taglib-1.5-orig/taglib/toolkit/tstring.cpp 2008-02-04 16:14:45.000000000 +0100
|
|
+++ taglib-1.5/taglib/toolkit/tstring.cpp 2009-09-04 12:07:00.506121756 +0200
|
|
@@ -35,7 +35,7 @@
|
|
|
|
inline unsigned short byteSwap(unsigned short x)
|
|
{
|
|
- return ((x) >> 8) & 0xff | ((x) & 0xff) << 8;
|
|
+ return (((x) >> 8) & 0xff) | (((x) & 0xff) << 8);
|
|
}
|
|
|
|
inline unsigned short combine(unsigned char c1, unsigned char c2)
|
|
@@ -510,6 +510,8 @@
|
|
|
|
TagLib::wchar &String::operator[](int i)
|
|
{
|
|
+ detach();
|
|
+
|
|
return d->data[i];
|
|
}
|
|
|
|
@@ -558,6 +560,8 @@
|
|
|
|
String &String::operator+=(char c)
|
|
{
|
|
+ detach();
|
|
+
|
|
d->data += uchar(c);
|
|
return *this;
|
|
}
|
|
diff -Nur taglib-1.5-orig/taglib/toolkit/tstring.h taglib-1.5/taglib/toolkit/tstring.h
|
|
--- taglib-1.5-orig/taglib/toolkit/tstring.h 2008-02-04 16:14:45.000000000 +0100
|
|
+++ taglib-1.5/taglib/toolkit/tstring.h 2009-09-04 12:07:03.465121011 +0200
|
|
@@ -31,7 +31,7 @@
|
|
#include "tbytevector.h"
|
|
|
|
#include <string>
|
|
-#include <ostream>
|
|
+#include <iostream>
|
|
|
|
/*!
|
|
* \relates TagLib::String
|