From: helge Date: Sun, 2 Apr 2006 15:28:08 +0000 (+0000) Subject: Applied Cocoa compatibility fix of Philippe Laval X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84c11603eaa6d653087aa938b291cb4f77407035;p=sope Applied Cocoa compatibility fix of Philippe Laval git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1240 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-appserver/samples/BasicAuthSession/Application.m b/sope-appserver/samples/BasicAuthSession/Application.m index 32fcaa83..672dac21 100644 --- a/sope-appserver/samples/BasicAuthSession/Application.m +++ b/sope-appserver/samples/BasicAuthSession/Application.m @@ -1,4 +1,23 @@ -// $Id: Application.m,v 1.1 2004/06/08 11:08:07 helge Exp $ +/* + Copyright (C) 2000-2005 SKYRIX Software AG + + This file is part of SOPE. + + SOPE 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 + Free Software Foundation; either version 2, or (at your option) any + later version. + + SOPE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with SOPE; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ #include diff --git a/sope-appserver/samples/BasicAuthSession/GNUmakefile b/sope-appserver/samples/BasicAuthSession/GNUmakefile index a59a18e4..41c44c24 100644 --- a/sope-appserver/samples/BasicAuthSession/GNUmakefile +++ b/sope-appserver/samples/BasicAuthSession/GNUmakefile @@ -1,4 +1,4 @@ -# $Id: GNUmakefile,v 1.1 2004/06/08 11:08:07 helge Exp $ +# GNUstep makefile include $(GNUSTEP_MAKEFILES)/common.make diff --git a/sope-appserver/samples/BasicAuthSession/Main.m b/sope-appserver/samples/BasicAuthSession/Main.m index 8a5c3afc..cae6785c 100644 --- a/sope-appserver/samples/BasicAuthSession/Main.m +++ b/sope-appserver/samples/BasicAuthSession/Main.m @@ -1,4 +1,23 @@ -// $Id: Main.m,v 1.1 2004/06/08 11:08:07 helge Exp $ +/* + Copyright (C) 2000-2005 SKYRIX Software AG + + This file is part of SOPE. + + SOPE 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 + Free Software Foundation; either version 2, or (at your option) any + later version. + + SOPE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with SOPE; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ #include diff --git a/sope-appserver/samples/BasicAuthSession/NSString+BasicAuth.h b/sope-appserver/samples/BasicAuthSession/NSString+BasicAuth.h index 0dbdc9f2..bb57fbac 100644 --- a/sope-appserver/samples/BasicAuthSession/NSString+BasicAuth.h +++ b/sope-appserver/samples/BasicAuthSession/NSString+BasicAuth.h @@ -1,4 +1,23 @@ -// $Id: NSString+BasicAuth.h,v 1.1 2004/06/08 11:08:07 helge Exp $ +/* + Copyright (C) 2000-2005 SKYRIX Software AG + + This file is part of SOPE. + + SOPE 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 + Free Software Foundation; either version 2, or (at your option) any + later version. + + SOPE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with SOPE; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ #ifndef __NSString_BasicAuth_H__ #define __NSString_BasicAuth_H__ diff --git a/sope-appserver/samples/BasicAuthSession/NSString+BasicAuth.m b/sope-appserver/samples/BasicAuthSession/NSString+BasicAuth.m index 47451290..52ab356c 100644 --- a/sope-appserver/samples/BasicAuthSession/NSString+BasicAuth.m +++ b/sope-appserver/samples/BasicAuthSession/NSString+BasicAuth.m @@ -1,4 +1,23 @@ -// $Id: NSString+BasicAuth.m,v 1.1 2004/06/08 11:08:07 helge Exp $ +/* + Copyright (C) 2000-2005 SKYRIX Software AG + + This file is part of SOPE. + + SOPE 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 + Free Software Foundation; either version 2, or (at your option) any + later version. + + SOPE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with SOPE; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ #include "NSString+BasicAuth.h" #include @@ -26,23 +45,23 @@ - (NSString *)loginOfHTTPBasicAuthorizationValue { NSString *s; - unsigned idx; + NSRange r; if ((s = [self decodedHTTPBasicAuthorizationValue]) == nil) return nil; - if ((idx = [s indexOfString:@":"]) == NSNotFound) + if ((r = [s rangeOfString:@":"]).length == 0) return nil; - return [s substringToIndex:idx]; + return [s substringToIndex:r.location]; } - (NSString *)passwordOfHTTPBasicAuthorizationValue { NSString *s; - unsigned idx; + NSRange r; if ((s = [self decodedHTTPBasicAuthorizationValue]) == nil) return nil; - if ((idx = [s indexOfString:@":"]) == NSNotFound) + if ((r = [s rangeOfString:@":"]).length == 0) return nil; - return [s substringFromIndex:(idx + 1)]; + return [s substringFromIndex:(r.location + r.length)]; } @end /* NSString(BasicAuth) */ diff --git a/sope-appserver/samples/BasicAuthSession/common.h b/sope-appserver/samples/BasicAuthSession/common.h index a9bbfa39..91e59923 100644 --- a/sope-appserver/samples/BasicAuthSession/common.h +++ b/sope-appserver/samples/BasicAuthSession/common.h @@ -1,3 +1,22 @@ -// $Id: common.h,v 1.1 2004/06/08 11:08:07 helge Exp $ +/* + Copyright (C) 2000-2005 SKYRIX Software AG + + This file is part of SOPE. + + SOPE 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 + Free Software Foundation; either version 2, or (at your option) any + later version. + + SOPE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with SOPE; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ #import diff --git a/sope-appserver/samples/ChangeLog b/sope-appserver/samples/ChangeLog index bf1ff0d5..076211fa 100644 --- a/sope-appserver/samples/ChangeLog +++ b/sope-appserver/samples/ChangeLog @@ -1,3 +1,8 @@ +2006-04-02 Philippe Laval + + * BasicAuthSession/NSString+BasicAuth.m: replaced usage of non-Cocoa + -indexOfString: with -rangeOfString: + 2004-02-29 Helge Hess * added the HelloWorld application example - the simplest application