You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cd also updates the PWD env var, but the supplied dir can also be relative (. or ..) and should then be resolved in the PWD var. Here's the code:
case CD: ; // (hackhackhack to allow declarions inside a switch)
char *dir;
if (comd->length == 1)
dir = getenv("HOME");
else {
CHK_ARGC("cd",1);
dir = comd->cmd[1];
}
CHK_ERR(chdir(dir), "cd");
setenv("PWD", dir, 1); // BUG: dir can be relative and should then be resolved
return EXIT_SUCCESS;
break;
The text was updated successfully, but these errors were encountered:
cd
also updates the PWD env var, but the supplied dir can also be relative (. or ..) and should then be resolved in the PWD var. Here's the code:The text was updated successfully, but these errors were encountered: