Project

General

Profile

Bug #1394 ยป getcwd.diff

Anonymous, 06/04/2009 02:00 PM

View differences:

sys/kern/vfs_cache.c
return (ENODEV);
buflen = uap->buflen;
if (buflen < 2)
if (buflen == 0)
return (EINVAL);
if (buflen > MAXPATHLEN)
buflen = MAXPATHLEN;
......
for (i = nch.ncp->nc_nlen - 1; i >= 0; i--) {
if (bp == buf) {
numcwdfail4++;
*error = ENOMEM;
*error = ERANGE;
return(NULL);
}
*--bp = nch.ncp->nc_name[i];
}
if (bp == buf) {
numcwdfail4++;
*error = ENOMEM;
*error = ERANGE;
return(NULL);
}
*--bp = '/';
......
if (!slash_prefixed) {
if (bp == buf) {
numcwdfail4++;
*error = ENOMEM;
*error = ERANGE;
return(NULL);
}
*--bp = '/';
    (1-1/1)