zsh-workers
 help / color / mirror / code / Atom feed
* LOGNAME no longer special parameter
@ 1995-07-24 11:44 Zoltan Hidvegi
  0 siblings, 0 replies; only message in thread
From: Zoltan Hidvegi @ 1995-07-24 11:44 UTC (permalink / raw)
  To: zsh-workers

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),


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-07-24 11:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-07-24 11:44 LOGNAME no longer special parameter Zoltan Hidvegi

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).