From: hzoli@cs.elte.hu (Zoltan Hidvegi)
To: zsh-workers@math.gatech.edu (zsh-workers)
Subject: LOGNAME no longer special parameter
Date: Mon, 24 Jul 1995 12:44:09 +0100 (MET DST) [thread overview]
Message-ID: <9507241044.AA06539@turan.elte.hu> (raw)
This patch (again) removes LOGNAME from the special parameters. This is
already part of my releases so do not apply that if you use that version.
Nothing is changed in the visible behaviour, but after the patch LOGNAME
becames a changable non-special parameter. This is useful for RCS which uses
LOGNAME to determine the author field when it checks in a file. Hopefully I
included everything here which is necessary (it is an old patch from my RCS).
Bye,
Zoltan
rcsdiff -qc -kk -r1.11 -r1.12 Src/params.c
*** Src/params.c
--- Src/params.c 1995/07/04 18:21:23
***************
*** 66,71 ****
--- 66,72 ----
argvparam = (Param) paramtab->getnode(paramtab, "argv");
+ setsparam("LOGNAME", ztrdup((str = getlogin()) && *str ? str : cached_username));
noerrs = 1;
/* Copy the environment variables we are inheriting to dynamic *
***************
*** 110,116 ****
pm = (Param) paramtab->getnode(paramtab, "LOGNAME");
if (!(pm->flags & PM_EXPORTED)) {
pm->flags |= PM_EXPORTED;
! pm->env = addenv("LOGNAME", login_name);
}
pm = (Param) paramtab->getnode(paramtab, "SHLVL");
if (!(pm->flags & PM_EXPORTED))
--- 111,117 ----
pm = (Param) paramtab->getnode(paramtab, "LOGNAME");
if (!(pm->flags & PM_EXPORTED)) {
pm->flags |= PM_EXPORTED;
! pm->env = addenv("LOGNAME", pm->u.str);
}
pm = (Param) paramtab->getnode(paramtab, "SHLVL");
if (!(pm->flags & PM_EXPORTED))
rcsdiff -qc -kk -r1.5 -r1.6 Src/init.c
*** Src/init.c
--- Src/init.c 1995/07/04 12:32:51
***************
*** 555,565 ****
cached_username = ztrdup("");
}
- /* Get info for `LOGNAME'. If getlogin fails, *
- * we'll take whatever is in `USERNAME'. */
- if (!(login_name = getlogin()))
- login_name = ztrdup(cached_username);
-
/* Try a cheap test to see if we can *
* initialize `PWD' from `HOME' */
if (ispwd(home))
--- 555,560 ----
rcsdiff -qc -kk -r1.3 -r1.4 Src/params.h
*** Src/params.h
--- Src/params.h 1995/07/04 14:23:18
***************
*** 105,111 ****
#define IPDEF6(A,B) {NULL,A,NULL,IFN(nullsetfn),IFN(strvargetfn),0,\
PM_SCALAR|PM_READONLY|PM_SPECIAL,(void *)B,NULL,NULL,NULL,0}
- IPDEF6("LOGNAME", &login_name),
IPDEF6("PWD", &pwd),
IPDEF6("TTY", &ttystrname),
--- 105,110 ----
rcsdiff -qc -kk -r1.6 -r1.7 Src/globals.h
*** Src/globals.h
--- Src/globals.h 1995/07/04 12:17:04
***************
*** 305,311 ****
EXTERN uid_t cached_uid;
EXTERN char *cached_username; /* $USERNAME */
- EXTERN char *login_name; /* $LOGNAME */
EXTERN char *zsh_name; /* ZSH_NAME */
EXTERN char *underscore; /* $_ */
--- 305,310 ----
rcsdiff -qc -kk -r1.6 -r1.7 Doc/zshparam.1
*** Doc/zshparam.1
--- Doc/zshparam.1 1995/07/04 17:28:36
***************
*** 205,212 ****
being executed.
.TP
.B LOGNAME
! The username corresponding to the user id of the shell process
! at the time of login.
.TP
.B MACHTYPE
The machine type (microprocessor class or machine model),
--- 205,214 ----
being executed.
.TP
.B LOGNAME
! If the corresponding variable is not set in the environment of the
! shell, it is initialized to the login name corresponding to the
! current login session. This parameter is exported by default but
! this can be disabled using the \fBtypeset\fP builtin.
.TP
.B MACHTYPE
The machine type (microprocessor class or machine model),
reply other threads:[~1995-07-24 11:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9507241044.AA06539@turan.elte.hu \
--to=hzoli@cs.elte.hu \
--cc=zsh-workers@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).