Fix a bug in previous commit where pkg_{delete,info} foo-1.0/ would segfault.
Noticed first by: kris
This commit is contained in:
parent
1a84c0e714
commit
150698377a
@ -89,10 +89,12 @@ main(int argc, char **argv)
|
||||
while( !isalpha(*(pkgs_split+1)) )
|
||||
{
|
||||
*pkgs_split = '\0';
|
||||
pkgs_split = rindex(*argv, (int) '/');
|
||||
if ( (pkgs_split = rindex(*argv, (int) '/')) == NULL )
|
||||
pkgs_split = *argv;
|
||||
}
|
||||
if(pkgs_split != NULL)
|
||||
{
|
||||
if (*pkgs_split == '/')
|
||||
pkgs_split++;
|
||||
*pkgs = pkgs_split;
|
||||
pkgs++;
|
||||
|
@ -151,10 +151,12 @@ main(int argc, char **argv)
|
||||
while( !isalpha(*(pkgs_split+1)) )
|
||||
{
|
||||
*pkgs_split = '\0';
|
||||
pkgs_split = rindex(*argv, (int) '/');
|
||||
if ( (pkgs_split = rindex(*argv, (int) '/')) == NULL)
|
||||
pkgs_split = *argv;
|
||||
}
|
||||
if(pkgs_split != NULL)
|
||||
{
|
||||
if (*pkgs_split == '/')
|
||||
pkgs_split++;
|
||||
*pkgs = pkgs_split;
|
||||
pkgs++;
|
||||
|
Loading…
Reference in New Issue
Block a user