Fix a bug in previous commit where pkg_{delete,info} foo-1.0/ would segfault.

Noticed first by: kris
This commit is contained in:
dan 2000-01-18 01:45:54 +00:00
parent 1a84c0e714
commit 150698377a
2 changed files with 8 additions and 4 deletions

View File

@ -89,11 +89,13 @@ 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)
{
pkgs_split++;
if (*pkgs_split == '/')
pkgs_split++;
*pkgs = pkgs_split;
pkgs++;
}

View File

@ -151,11 +151,13 @@ 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)
{
pkgs_split++;
if (*pkgs_split == '/')
pkgs_split++;
*pkgs = pkgs_split;
pkgs++;
}