Avoid duplicate '/'

This commit is contained in:
Pierre Pronchery 2004-08-07 16:30:49 +00:00
parent ce2ecbe2e5
commit 3a68bc8458

View File

@ -93,7 +93,8 @@ static int _chgrp_do_recursive_do(int opts, gid_t gid, char * file)
}
readdir(dir);
readdir(dir);
len = strlen(file) + 2;
len = strlen(file);
len += (len && file[len-1] == '/') ? 1 : 2;
if((s = malloc(len)) == NULL)
{
fprintf(stderr, "%s", "chgrp: ");