mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
fix error in uuencoding
CVr: ---------------------------------------------------------------------- git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18810 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4777397f4f
commit
a4b75cc267
1 changed files with 9 additions and 4 deletions
|
@ -3127,17 +3127,22 @@ static NSCharacterSet *tokenSet = nil;
|
||||||
else if (pos > 6 && strncmp(bytes, "begin ", 6) == 0)
|
else if (pos > 6 && strncmp(bytes, "begin ", 6) == 0)
|
||||||
{
|
{
|
||||||
unsigned off = 6;
|
unsigned off = 6;
|
||||||
|
unsigned end = pos;
|
||||||
NSData *d;
|
NSData *d;
|
||||||
|
|
||||||
while (off < pos && bytes[off] >= '0' && bytes[off] <= '7')
|
if (end > off && bytes[end-1] == '\r')
|
||||||
|
{
|
||||||
|
end--;
|
||||||
|
}
|
||||||
|
while (off < end && bytes[off] >= '0' && bytes[off] <= '7')
|
||||||
{
|
{
|
||||||
off++;
|
off++;
|
||||||
}
|
}
|
||||||
while (off < pos && bytes[off] == ' ')
|
while (off < end && bytes[off] == ' ')
|
||||||
{
|
{
|
||||||
off++;
|
off++;
|
||||||
}
|
}
|
||||||
d = [NSData dataWithBytes: &bytes[off] length: pos - off];
|
d = [NSData dataWithBytes: &bytes[off] length: end - off];
|
||||||
name = [[NSString alloc] initWithData: d
|
name = [[NSString alloc] initWithData: d
|
||||||
encoding: NSASCIIStringEncoding];
|
encoding: NSASCIIStringEncoding];
|
||||||
AUTORELEASE(name);
|
AUTORELEASE(name);
|
||||||
|
@ -3329,7 +3334,7 @@ static NSCharacterSet *tokenSet = nil;
|
||||||
/*
|
/*
|
||||||
* Now we encode the actual data for the line.
|
* Now we encode the actual data for the line.
|
||||||
*/
|
*/
|
||||||
for (pos = 0; count > 0; count -= 3, pos += 3)
|
for (pos = 0; count > 0; count -= 3)
|
||||||
{
|
{
|
||||||
unsigned char tmp[3];
|
unsigned char tmp[3];
|
||||||
int c;
|
int c;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue