Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh on u/win on NT?



Zefram wrote:

> Dave Yost wrote:
> >I tried to bring up zsh on u/win and failed.  It's not in the compilation, but in the stuff before that, which is pretty hairy,
>
> Where is it failing?

Well it's been a while since I last tried, so I'll have to go back and get back into it.  Anyway, here are some changes I made to get 4.0.5 to compile.  It would be great if someone would roll these changes or their equivalent into the current development version.  Then maybe I should start fresh with that.

diff -rc ../a-3.0.5/Src/cond.c ./Src/cond.c
*** ../a-3.0.5/Src/cond.c       Mon Mar 30 09:50:52 1998
--- ./Src/cond.c        Mon Jun 02 22:11:26 1997
***************
*** 74,83 ****
        return (S_ISREG(dostat(c->left)));
      case 'g':
        return (!!(dostat(c->left) & S_ISGID));
- #ifdef S_ISVTX
      case 'k':
        return (!!(dostat(c->left) & S_ISVTX));
- #endif
      case 'n':
        return (!!strlen(c->left));
      case 'o':
--- 74,81 ----
diff -rc ../a-3.0.5/Src/exec.c ./Src/exec.c
*** ../a-3.0.5/Src/exec.c       Mon Mar 30 12:32:21 1998
--- ./Src/exec.c        Thu Sep 25 18:42:16 1997
***************
*** 1446,1456 ****
            holdintr();
        /* Check if we should run background jobs at a lower priority. */
        if ((how & Z_ASYNC) && isset(BGNICE))
- #ifndef NO_NICE
            nice(5);
- #else
-           ;
- #endif

      } else if (is_cursh) {
        /* This is a current shell procedure that didn't need to fork.    *
--- 1446,1452 ----
diff -rc ../a-3.0.5/Src/glob.c ./Src/glob.c
*** ../a-3.0.5/Src/glob.c       Mon Mar 30 12:49:56 1998
--- ./Src/glob.c        Thu Sep 25 18:42:16 1997
***************
*** 36,46 ****
  {
      char *us = unmeta(s);

!     return access(us,0) == 0
! #ifndef NO_SYMLINKS
!       || readlink(us,NULL,0) == 0
! #endif
!         ;
  }

  static int mode;              /* != 0 if we are parsing glob patterns */
--- 36,42 ----
  {
      char *us = unmeta(s);

!     return access(us,0) == 0 || readlink(us,NULL,0) == 0;
  }

  static int mode;              /* != 0 if we are parsing glob patterns */
diff -rc ../a-3.0.5/Src/hashtable.c ./Src/hashtable.c
*** ../a-3.0.5/Src/hashtable.c  Mon Mar 30 12:07:08 1998
--- ./Src/hashtable.c   Tue Dec 17 12:14:11 1996
***************
*** 1152,1158 ****
  void
  fillnameddirtable(HashTable ht)
  {
- #ifndef NO_GETPWENT
      if (!allusersadded) {
        struct passwd *pw;

--- 1152,1157 ----
***************
*** 1166,1172 ****
        endpwent();
        allusersadded = 1;
      }
- #endif
      return;
  }

--- 1165,1170 ----
diff -rc ../a-3.0.5/Src/params.c ./Src/params.c
*** ../a-3.0.5/Src/params.c     Mon Mar 30 11:26:29 1998
--- ./Src/params.c      Thu Sep 25 18:42:17 1997
***************
*** 1702,1715 ****
  homesetfn(Param pm, char *x)
  {
      zsfree(home);
! #ifndef NO_SYMLINKS
!     if (   x
!         && isset(CHASELINKS)
!         && (home = xsymlink(x))
!        )
        zsfree(x);
      else
- #endif
        home = x ? x : ztrdup("");
      finddir(NULL);
  }
--- 1702,1710 ----
  homesetfn(Param pm, char *x)
  {
      zsfree(home);
!     if (x && isset(CHASELINKS) && (home = xsymlink(x)))
        zsfree(x);
      else
        home = x ? x : ztrdup("");
      finddir(NULL);
  }
diff -rc ../a-3.0.5/Src/system.h ./Src/system.h
*** ../a-3.0.5/Src/system.h     Mon Mar 30 12:33:51 1998
--- ./Src/system.h      Mon Jun 02 22:11:28 1997
***************
*** 268,276 ****
  #endif

  #ifdef HAVE_UTMPX_H
  # define STRUCT_UTMP struct utmpx
  # define ut_time ut_xtime
- # include <utmpx.h>
  #else
  # include <utmp.h>
  # define STRUCT_UTMP struct utmp
--- 268,276 ----
  #endif

  #ifdef HAVE_UTMPX_H
+ # include <utmpx.h>
  # define STRUCT_UTMP struct utmpx
  # define ut_time ut_xtime
  #else
  # include <utmp.h>
  # define STRUCT_UTMP struct utmp
***************
*** 474,482 ****
  #if MUST_DEFINE_OSPEED
  extern char PC, *BC, *UP;
  extern short ospeed;
- #endif
-
- #ifndef S_ISLNK
- # define S_ISLNK(x) 0 /* false - DY */
  #endif

--- 474,478 ----
diff -rc ../a-3.0.5/Src/utils.c ./Src/utils.c
*** ../a-3.0.5/Src/utils.c      Mon Mar 30 12:08:46 1998
--- ./Src/utils.c       Thu Sep 25 18:42:18 1997
***************
*** 315,328 ****
            *p = '\0';
            continue;
        }
- #ifndef NO_SYMLINKS
        if (unset(CHASELINKS)) {
- #endif
            strcat(xbuf, "/");
            strcat(xbuf, *pp);
            zsfree(*pp);
            continue;
- #ifndef NO_SYMLINKS
        }
        sprintf(xbuf2, "%s/%s", xbuf, *pp);
        t0 = readlink(unmeta(xbuf2), xbuf3, PATH_MAX);
--- 315,325 ----
***************
*** 340,346 ****
                return 1;
            zsfree(*pp);
        }
- #endif
      }
      free(opp);
      return 0;
--- 337,342 ----
***************
*** 352,360 ****
  char *
  xsymlink(char *s)
  {
- #ifndef NO_SYMLINKS
      if (unset(CHASELINKS))
- #endif
        return ztrdup(s);
      if (*s != '/')
        return NULL;
--- 348,354 ----
diff -rc ../a-3.0.5/Src/watch.c ./Src/watch.c
*** ../a-3.0.5/Src/watch.c      Mon Mar 30 10:45:43 1998
--- ./Src/watch.c       Fri Jun 28 06:43:51 1996
***************
*** 47,57 ****
      int srchlimit = 50;               /* max number of wtmp records to search */

      if (inout)
- #ifdef XTV
-       return u->ut_tv.tv_sec;
- #else
        return u->ut_time;
- #endif
      if (!(in = fopen(WTMP_FILE, "r")))
        return time(NULL);
      fseek(in, 0, 2);
--- 47,53 ----
***************
*** 65,75 ****
            fclose(in);
            return time(NULL);
        }
- #ifdef XTV
-       if (uu.ut_tv.tv_sec < lastwatch || !srchlimit--) {
- #else
        if (uu.ut_time < lastwatch || !srchlimit--) {
- #endif
            fclose(in);
            return time(NULL);
        }
--- 61,67 ----
***************
*** 83,93 ****
        }
      while (strncmp(uu.ut_line, u->ut_line, sizeof(u->ut_line)));
      fclose(in);
! #ifdef XTV
!     return uu.ut_tv.tv_sec;
! #else
!     return uu.ut_tiime;
! #endif
  }

  /* Mutually recursive call to handle ternaries in $WATCHFMT */
--- 75,81 ----
        }
      while (strncmp(uu.ut_line, u->ut_line, sizeof(u->ut_line)));
      fclose(in);
!     return uu.ut_time;
  }

  /* Mutually recursive call to handle ternaries in $WATCHFMT */
***************
*** 346,362 ****
  int
  ucmp(STRUCT_UTMP *u, STRUCT_UTMP *v)
  {
- #ifdef XTV
-     if (u->ut_tv.tv_sec == v->ut_tv.tv_sec)
- #else
      if (u->ut_time == v->ut_time)
- #endif
        return strncmp(u->ut_line, v->ut_line, sizeof(u->ut_line));
- #ifdef XTV
-     return u->ut_tv.tv_sec - v->ut_tv.tv_sec;
- #else
      return u->ut_time - v->ut_time;
- #endif
  }

  /* initialize the user List */
--- 334,342 ----
diff -rc ../a-3.0.5/Src/zle_main.c ./Src/zle_main.c
*** ../a-3.0.5/Src/zle_main.c   Mon Mar 30 11:12:43 1998
--- ./Src/zle_main.c    Thu Sep 25 18:42:19 1997
***************
*** 94,101 ****
                        | FLUSHO
  # endif
        );
! # ifdef SGTABTYPE
!     ti.tio.c_oflag &= ~SGTABTYPE;
  # endif
      ti.tio.c_oflag |= ONLCR;
      ti.tio.c_cc[VQUIT] =
--- 94,107 ----
                        | FLUSHO
  # endif
        );
! # ifdef TAB3
!     ti.tio.c_oflag &= ~TAB3;
! # else
! #  ifdef OXTABS
!     ti.tio.c_oflag &= ~OXTABS;
! #  else
!     ti.tio.c_oflag &= ~XTABS;
! #  endif
  # endif
      ti.tio.c_oflag |= ONLCR;
      ti.tio.c_cc[VQUIT] =
***************
*** 150,158 ****
        */

  #else                         /* not HAS_TIO */
! # ifdef SGTABTYPE
!     ti.sgttyb.sg_flags = (ti.sgttyb.sg_flags | CBREAK) & ~ECHO & ~SGTABTYPE;
! # endif
      ti.lmodes &= ~LFLUSHO;
      eofchar = ti.tchars.t_eofc;
      ti.tchars.t_quitc =
--- 156,162 ----
        */

  #else                         /* not HAS_TIO */
!     ti.sgttyb.sg_flags = (ti.sgttyb.sg_flags | CBREAK) & ~ECHO & ~XTABS;
      ti.lmodes &= ~LFLUSHO;
      eofchar = ti.tchars.t_eofc;
      ti.tchars.t_quitc =
diff -rc ../a-3.0.5/Src/zle_refresh.c ./Src/zle_refresh.c
*** ../a-3.0.5/Src/zle_refresh.c        Mon Mar 30 11:17:06 1998
--- ./Src/zle_refresh.c Thu Sep 25 18:42:19 1997
***************
*** 194,203 ****
      hasam;                    /* terminal should have auto-margin         */
  static int put_rpmpt,         /* whether we should display right-prompt   */
      oput_rpmpt,                       /* whether displayed right-prompt last time */
-
- #ifdef SGTABTYPE
      oxtabs,                   /* oxtabs - tabs expand to spaces if set    */
- #endif
      numscrolls, onumscrolls;
  extern int clearflag;         /* set to non-zero if alwayslastprompt used */

--- 194,200 ----
***************
*** 231,239 ****

  /* Nov 96: <mason>  I haven't checked how complete this is.  sgtty stuff may
     or may not work */
- #ifdef SGTABTYPE
      oxtabs = ((SGTTYFLAG & SGTABTYPE) == SGTABTYPE);
- #endif

      cleareol = 0;             /* unset */
      more_start = more_end = 0;        /* unset */
--- 228,234 ----
***************
*** 862,868 ****
      }

  /* try tabs if tabs are non destructive and multright is not possible */
- #ifdef SGTABTYPE
      if (!oxtabs && tccan(TCNEXTTAB) && ((vcs | 7) < cl)) {
        i = (vcs | 7) + 1;
        tcout(TCNEXTTAB);
--- 857,862 ----
***************
*** 871,877 ****
        if ((ct = cl - i) == 0) /* number of chars still to move across */
            return;
      }
- #endif

  /* otherwise _carefully_ write the contents of the video buffer.
     if we're anywhere in the prompt, goto the left column and write the whole
--- 865,870 ----
diff -rc ../a-3.0.5/Src/zsh.h ./Src/zsh.h
*** ../a-3.0.5/Src/zsh.h        Mon Mar 30 11:08:19 1998
--- ./Src/zsh.h Thu Sep 25 18:42:20 1997
***************
*** 1209,1217 ****
  #  ifdef OXTABS
  #define SGTABTYPE       OXTABS
  #  else
- #   ifdef XTABS
  #define SGTABTYPE       XTABS
- #   endif
  #  endif
  # endif

--- 1209,1215 ----





Messages sorted by: Reverse Date, Date, Thread, Author