diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-03-18 16:27:44 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-11-17 12:13:31 -0800 |
commit | ff499b8904af94ebae9c83e0f2b15afc120c9d75 (patch) | |
tree | 57498f34e65371ce80c908a66ad8675e532a94f7 /winsup/cygwin/binmode.c | |
parent | 6900a42323bfe9a909deddb27126a5e4e997d979 (diff) | |
download | cygnal-ff499b8904af94ebae9c83e0f2b15afc120c9d75.tar.gz cygnal-ff499b8904af94ebae9c83e0f2b15afc120c9d75.tar.bz2 cygnal-ff499b8904af94ebae9c83e0f2b15afc120c9d75.zip |
Use Windows values in passwd and HOME env var.
In this patch, the path to the Windows command interpreter
is reported in the shell field of struct passwd by getpwent
by default rather than "/bin/bash". The value of USERPROFILE
is used for the home field rather than "/home/<user>".
Also, the HOME environment variable is stuffed with a copy
of USERPROFILE.
The HOME issue solves the following problem: some OSS programs
on Windows, such as Vim, respond to a HOME variable. If it
has garbage contents that make no sense like "/home/bob",
they don't behave well.
* winsup/cygwin/grp.cc (pwdgrp::init_grp): Initialize new
pwd_sep member.
* winsup/cygwin/passwd.cc (pwdgrp::parse_passwd): Use pwd_sep
rather than hard-coded colon.
(pwdgrp::init_pwd): Initialize pwd_sep.
* winsup/cygwin/pwdgrp.h (class pwdgrp): New member, pwd_sep.
* winsup/cygwin/uinfo.cc (cygheap_user::ontherange): Copy
value of USERPROFILE into HOME.
(pwdgrp::next_num, pwdgrp::fetch_account_from_line): Use
pwd_sep rather than ':'.
(pwdgrp::next_num, pwdgrp::fetch_account_from_windows): Get
real Windows shell as default shell field. Get USERPROFILE
as home directory. Use '|' as the field separator because
these fields contain colons. Set pwd_sep to '|'.
Diffstat (limited to 'winsup/cygwin/binmode.c')
0 files changed, 0 insertions, 0 deletions