Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4a48c996076b89c64934c1771ff5d638@smtp.hushmail.com>
Date: Wed, 13 Mar 2013 07:59:40 +0100
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: gpg2john (was: Work needed before Jumbo-8)

On 13 Mar, 2013, at 7:45 , magnum <john.magnum@...hmail.com> wrote:
> basename(3) varies with platform. I think this is portable:
> 
> 	#include <libgen.h>
> 	#include <string.h>
> 	
> 	char *login;
> 	int len;
> 
> 	login = basename(strdup(filename));
> 	if (!login || !*login)
> 		strcpy(login, filename);
> 	len = strlen(login) - 4;
> 	if (strcmp(&login[len], ".gpg" ||
> 	    strcmp(&login[len], ".pgp")
> 		login[len] = 0;

s/strcmp/!strcmp/g

magnum

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.