Changeset 76

Show
Ignore:
Timestamp:
12/27/05 14:44:09 (3 years ago)
Author:
mrowe
Message:

Replace uses of -[NSString cString] + strstr/strcmp with their NSString equivalents. Closes #37.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/AgentController.m

    r75 r76  
    709709                        theOutput = [[[NSString alloc] initWithData:[[thePipe fileHandleForReading] readDataToEndOfFile] encoding:NSASCIIStringEncoding] autorelease]; 
    710710         
    711                         if(strstr([theOutput cString], "ScreenSaverEngine.app") != nil
     711                        if ([theOutput rangeOfString:@"ScreenSaverEngine.app"].location != NSNotFound
    712712                        { 
    713713                                if((([[NSUserDefaults standardUserDefaults] integerForKey:OnScreensaverString] == 2) 
  • trunk/Libs/SSHAgent.m

    r75 r76  
    183183                /* Split the line with delimiter " ". */ 
    184184                columns = [[lines objectAtIndex:i] componentsSeparatedByString:@" "]; 
     185                if ([columns count] != 3) 
     186                        continue; 
    185187 
    186188                /* If 2nd column matches "SSH_AUTH_SOCK", then 3rd column is the socket path. */ 
    187                 if(([columns count] == 3) && (strcmp([[columns objectAtIndex:1] cString], "SSH_AUTH_SOCK") == 0)
     189                if ([@"SSH_AUTH_SOCK" isEqualToString:[columns objectAtIndex:1]]
    188190                { 
    189191                        [agentSocketPathLock lock]; 
     
    193195 
    194196                /* If 2nd column matches "SSH_AGENT_PID", then 3rd column is the PID. */ 
    195                 if(([columns count] == 3) && (strcmp([[columns objectAtIndex:1] cString], "SSH_AGENT_PID") == 0)
     197                if ([@"SSH_AGENT_PID" isEqualToString:[columns objectAtIndex:1]]
    196198                { 
    197199                        [thePidLock lock]; 
  • trunk/UpdateController.m

    r49 r76  
    8989        } 
    9090 
    91         else if(strcmp([latestVersion cString], [currentVersion cString]) > 0
     91        else if ([latestVersion compare:currentVersion] == NSOrderedDescending
    9292        { 
    9393                if((downloadURL) && (changesURL))