Referring to gcc4/recipe/files/gcc/libunix/pwd/pwdread.c
The default for setting the home directory
home = getenv("Choices$Write");
returns Boot:Choices which then forces the following unix style
dotfile path to be issued as a RISC OS path (no good)
I am using the following in pwdread as a functional equivalent for
the intended path. It has to know the drive booted from so that if
the csd is changed to another HD it wont try to use that instead.
/* If not, try Boot$Dir to get the booted HD name and zero the
$ so the unix pathname of Choices can be appended */
if (!home)
home = getenv("Boot$Dir");
if (strtok(home, "$") != 0)
strcat(home, "$/!Boot/Choices");
This compiles and works, but I welcome corrections.
While on this topic, I'll suggest the possibility that maybe we
could use a subdir in Choices to accommodate the numerous dotfiles
that could clutter the Choices directory.
In the linux world they seem to be referred to as dotfiles so
perhaps that would be a suitable name for the subdir.
I think most setting files are dotfiles or dotdirs with dotfiles,
but it would mean anything else directed to ~ would be directed to
Choices/dotfiles also.
I think there are people using !UnixHome as a means but I thought
a while ago I read it was to be avoided in the future?
But secondly, using a default, allows ports like Bash and OpenSSH
to work out of the box seamlessly.
This is a different subject really, changes do not necessarily
affect each other.
I have noticed that my 10.04 distro does not recognise cd ~
but requires cd ~/
Bash on RISC OS is happy with cd ~ (1) so Iam guessing that Ubuntu
and maybe others adapt a modifier so that ~/ must be used to
get to the home directory contrary to other policy.
(1) Even though I have made this change to my Recipe's riscosify.c
if (in[0] == '~' && in[1] == '/')
{
char new_buffer[MAXPATHLEN];
const char *home =
#ifdef __TARGET_SCL__
getenv ("UnixEnv$HOME") ? : getenv ("HOME");
#else
__pwddefault ()->pw_dir;
No comments:
Post a Comment