From: helge Date: Sat, 2 Oct 2004 14:55:33 +0000 (+0000) Subject: improvements in edge conditions X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c580580cb8eb6c779231fe420c26571cf4e2e406;p=sope improvements in edge conditions git-svn-id: http://svn.opengroupware.org/SOPE/trunk@215 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-core/NGExtensions/ChangeLog b/sope-core/NGExtensions/ChangeLog index 41b9cdce..f799bb5c 100644 --- a/sope-core/NGExtensions/ChangeLog +++ b/sope-core/NGExtensions/ChangeLog @@ -1,3 +1,12 @@ +2004-10-02 Helge Hess + + * NGQuotedPrintableCoding.m: minor code cleanups (v4.3.119) + +2004-10-01 Helge Hess + + * FdExt.subproj/NSException+misc.m: check whether nil is being passed + in as the exception format (v4.3.118) + 2004-09-27 Helge Hess * NGBundleManager.m: removed a warning on MacOSX (v4.3.117) diff --git a/sope-core/NGExtensions/FdExt.subproj/NSException+misc.m b/sope-core/NGExtensions/FdExt.subproj/NSException+misc.m index c3d78fc6..6b7d4bfc 100644 --- a/sope-core/NGExtensions/FdExt.subproj/NSException+misc.m +++ b/sope-core/NGExtensions/FdExt.subproj/NSException+misc.m @@ -18,7 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ #include "NSException+misc.h" #include "common.h" @@ -38,9 +37,13 @@ NSString *tmp = nil; va_list ap; + if (_format == nil) + NSLog(@"ERROR(%s): missing format!", __PRETTY_FUNCTION__); + va_start(ap, _format); tmp = [[NSString allocWithZone:[self zone]] - initWithFormat:_format arguments:ap]; + initWithFormat:_format ? _format : @"Exception" + arguments:ap]; va_end(ap); self = [self initWithReason:tmp userInfo:nil]; @@ -48,6 +51,8 @@ return self; } +/* NSCopying */ + - (id)copyWithZone:(NSZone *)_zone { // TODO: should make a real copy? return [self retain]; diff --git a/sope-core/NGExtensions/NGExtensions/NGQuotedPrintableCoding.h b/sope-core/NGExtensions/NGExtensions/NGQuotedPrintableCoding.h index a69e4496..c7a32133 100644 --- a/sope-core/NGExtensions/NGExtensions/NGQuotedPrintableCoding.h +++ b/sope-core/NGExtensions/NGExtensions/NGQuotedPrintableCoding.h @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2003 SKYRIX Software AG + Copyright (C) 2000-2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the @@ -18,7 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ #ifndef __NGExtensions_NGQuotedPrintableCoding_H__ #define __NGExtensions_NGQuotedPrintableCoding_H__ @@ -30,7 +29,15 @@ /* Quoted Printable encoder/decoder - As specified in RFC 822 + As specified in RFC 822. + + TODO: explain what it does. It doesn't seem to decode a full line like + "=?iso-8859-1?q?Yannick=20DAmboise?=" + but only turns "=20D" style encodings to their charcode. + Note: apparently sope-mime contains a category on NSData which provides a + method to decode the full value: + -decodeQuotedPrintableValueOfMIMEHeaderField: + (NGMimeMessageParser) */ @interface NSString(QuotedPrintableCoding) diff --git a/sope-core/NGExtensions/NGQuotedPrintableCoding.m b/sope-core/NGExtensions/NGQuotedPrintableCoding.m index 23c0845a..586ebc8c 100644 --- a/sope-core/NGExtensions/NGQuotedPrintableCoding.m +++ b/sope-core/NGExtensions/NGQuotedPrintableCoding.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2003 SKYRIX Software AG + Copyright (C) 2000-2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the @@ -18,10 +18,9 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ -#include "common.h" #include "NGQuotedPrintableCoding.h" +#include "common.h" #include "NGMemoryAllocation.h" @implementation NSString(QuotedPrintableCoding) @@ -30,12 +29,12 @@ NSData *data; unsigned len; - if ((len = [self cStringLength])) { + if ((len = [self cStringLength]) > 0) { void *buf; buf = malloc(len + 10); [self getCString:buf]; data = [NSData dataWithBytes:buf length:len]; - free(buf); + if (buf) free(buf); } else data = [NSData data]; diff --git a/sope-core/NGExtensions/Version b/sope-core/NGExtensions/Version index b53ee6fd..1dfd267e 100644 --- a/sope-core/NGExtensions/Version +++ b/sope-core/NGExtensions/Version @@ -1,6 +1,6 @@ # version -SUBMINOR_VERSION:=117 +SUBMINOR_VERSION:=119 # v4.3.115 requires libFoundation v1.0.59 # v4.2.72 requires libEOControl v4.2.39