home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume19 / zsh2.00 / patch02c < prev    next >
Encoding:
Text File  |  1991-05-16  |  50.6 KB  |  2,211 lines

  1. Newsgroups: comp.sources.misc
  2. From: Paul Falstad <pfalstad@phoenix.princeton.edu>
  3. Subject:  v19i069:  zsh2.00 - The Z shell, Patch02c/6
  4. Message-ID: <1991May15.220214.7330@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 67d81ec2075c00a03952cada29949594
  6. Date: Wed, 15 May 1991 22:02:14 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Paul Falstad <pfalstad@phoenix.princeton.edu>
  10. Posting-number: Volume 19, Issue 69
  11. Archive-name: zsh2.00/patch02c
  12. Patch-To: zsh2.00: Volume 18, Issue 84-98
  13.  
  14. #!/bin/sh
  15. # this is zpatch.03 (part 3 of a multipart archive)
  16. # do not concatenate these parts, unpack them in order with /bin/sh
  17. # file patches continued
  18. #
  19. if test ! -r _shar_seq_.tmp; then
  20.     echo 'Please unpack part 1 first!'
  21.     exit 1
  22. fi
  23. (read Scheck
  24.  if test "$Scheck" != 3; then
  25.     echo Please unpack part "$Scheck" next!
  26.     exit 1
  27.  else
  28.     exit 0
  29.  fi
  30. ) < _shar_seq_.tmp || exit 1
  31. echo 'x - continuing file patches'
  32. sed 's/^X//' << 'SHAR_EOF' >> 'patches' &&
  33. X          }
  34. X  }
  35. X  
  36. ! void savehistfile() /**/
  37. X  {
  38. ! char *s,*t;
  39. X  Lknode n;
  40. X  Lklist l;
  41. X  FILE *out;
  42. X  
  43. !     if (!(s = getsparam("HISTFILE")) || !interact)
  44. X          return;
  45. X      if (out = fdopen(open(s,O_CREAT|O_WRONLY|O_TRUNC,0600),"w"))
  46. X          {
  47. --- 491,509 ----
  48. X          fclose(in);
  49. X          lastalloc();
  50. X          }
  51. +     else if (err)
  52. +         zerr("can't read history file",s,0);
  53. X  }
  54. X  
  55. ! void savehistfile(s,err) /**/
  56. ! char *s;int err;
  57. X  {
  58. ! char *t;
  59. X  Lknode n;
  60. X  Lklist l;
  61. X  FILE *out;
  62. X  
  63. !     if (!s || !interact)
  64. X          return;
  65. X      if (out = fdopen(open(s,O_CREAT|O_WRONLY|O_TRUNC,0600),"w"))
  66. X          {
  67. ***************
  68. *** 495,499 ****
  69. --- 525,531 ----
  70. X              }
  71. X          fclose(out);
  72. X          }
  73. +     else if (err)
  74. +         zerr("can't write history file: %s",s,0);
  75. X  }
  76. X  
  77. *** src/zsh0/zsh2.00/src/init.pro    Tue Apr 23 00:29:59 1991
  78. --- zsh2.00/src/init.pro    Tue May  7 22:53:26 1991
  79. ***************
  80. *** 8,12 ****
  81. X  void addreswords DCLPROTO((void));
  82. X  void runscripts DCLPROTO((void));
  83. X  void ainit DCLPROTO((void));
  84. ! void readhistfile DCLPROTO((void));
  85. ! void savehistfile DCLPROTO((void));
  86. --- 8,12 ----
  87. X  void addreswords DCLPROTO((void));
  88. X  void runscripts DCLPROTO((void));
  89. X  void ainit DCLPROTO((void));
  90. ! void readhistfile DCLPROTO((char *s,int err));
  91. ! void savehistfile DCLPROTO((char *s,int err));
  92. *** src/zsh0/zsh2.00/src/jobs.c    Tue Apr 23 00:30:05 1991
  93. --- zsh2.00/src/jobs.c    Wed May  8 22:36:12 1991
  94. ***************
  95. *** 31,37 ****
  96. X  */
  97. X  
  98. X  #include "zsh.h"
  99. - #include "funcs.h"
  100. X  #include <sys/errno.h>
  101. X  
  102. X  #define WCOREDUMPED(x) ((x)&0x80)
  103. --- 31,36 ----
  104. ***************
  105. *** 162,167 ****
  106. --- 161,167 ----
  107. X          if (!val)
  108. X              {
  109. X              gettyinfo(&shttyinfo);
  110. +             sanetty(&shttyinfo);
  111. X  #ifdef TIOCSWINSZ
  112. X              if (!(columns = shttyinfo.winsize.ws_col))
  113. X                  columns = 80;
  114. ***************
  115. *** 213,219 ****
  116. X  Job jn;int lng;
  117. X  {
  118. X  int job = jn-jobtab,len = 9,sig = -1,sflag = 0,llen,printed = 0;
  119. ! int conted = 0,lineleng = getlineleng(),doputnl = 0,skip = 0;
  120. X  struct process *pn;
  121. X  
  122. X      if (lng < 0)
  123. --- 213,219 ----
  124. X  Job jn;int lng;
  125. X  {
  126. X  int job = jn-jobtab,len = 9,sig = -1,sflag = 0,llen,printed = 0;
  127. ! int conted = 0,lineleng = getlineleng(),skip = 0,doputnl = 0;
  128. X  struct process *pn;
  129. X  
  130. X      if (lng < 0)
  131. ***************
  132. *** 238,244 ****
  133. X                      len = llen;
  134. X                  if (sig != SIGINT && sig != SIGPIPE)
  135. X                      sflag = 1;
  136. !                 if (sig == SIGINT && job == thisjob && interact)
  137. X                      doputnl = 1;
  138. X                  }
  139. X              else if (WIFSTOPPED(SP(pn->statusp)))
  140. --- 238,246 ----
  141. X                      len = llen;
  142. X                  if (sig != SIGINT && sig != SIGPIPE)
  143. X                      sflag = 1;
  144. !                 else if (sig == SIGINT)
  145. !                     errflag = 1;
  146. !                 if (job == thisjob && sig == SIGINT)
  147. X                      doputnl = 1;
  148. X                  }
  149. X              else if (WIFSTOPPED(SP(pn->statusp)))
  150. ***************
  151. *** 246,252 ****
  152. X                  sig = WSTOPSIG(SP(pn->statusp));
  153. X                  if (strlen(sigmsg[sig]) > len)
  154. X                      len = strlen(sigmsg[sig]);
  155. !                 if (handling && (!waiting || sig == SIGSTOP))
  156. X                      doputnl = 1;
  157. X                  }
  158. X              else if (isset(PRINTEXITVALUE) && WEXITSTATUS(SP(pn->statusp)))
  159. --- 248,254 ----
  160. X                  sig = WSTOPSIG(SP(pn->statusp));
  161. X                  if (strlen(sigmsg[sig]) > len)
  162. X                      len = strlen(sigmsg[sig]);
  163. !                 if (job == thisjob && sig == SIGTSTP)
  164. X                      doputnl = 1;
  165. X                  }
  166. X              else if (isset(PRINTEXITVALUE) && WEXITSTATUS(SP(pn->statusp)))
  167. ***************
  168. *** 324,331 ****
  169. X              fline = 0;
  170. X              }
  171. X          printed = 1;
  172. -         fflush(stderr);
  173. X          }
  174. X  
  175. X      /* print "(pwd now: foo)" messages */
  176. X  
  177. --- 326,335 ----
  178. X              fline = 0;
  179. X              }
  180. X          printed = 1;
  181. X          }
  182. +     else if (doputnl && interact)
  183. +         putc('\n',stderr);
  184. +     fflush(stderr);
  185. X  
  186. X      /* print "(pwd now: foo)" messages */
  187. X  
  188. ***************
  189. *** 387,398 ****
  190. X  int t0;
  191. X  
  192. X      for (t0 = MAXJOB-1; t0; t0--)
  193. !         if (jobtab[t0].stat && jobtab[t0].stat & STAT_STOPPED &&
  194. X                  t0 != curjob && t0 != thisjob)
  195. X              break;
  196. X      if (!t0)
  197. X          for (t0 = MAXJOB-1; t0; t0--)
  198. !             if (jobtab[t0].stat && t0 != curjob && t0 != thisjob)
  199. X                  break;
  200. X      prevjob = (t0) ? t0 : -1;
  201. X  }
  202. --- 391,402 ----
  203. X  int t0;
  204. X  
  205. X      for (t0 = MAXJOB-1; t0; t0--)
  206. !         if ((jobtab[t0].stat & STAT_INUSE) && (jobtab[t0].stat & STAT_STOPPED) &&
  207. X                  t0 != curjob && t0 != thisjob)
  208. X              break;
  209. X      if (!t0)
  210. X          for (t0 = MAXJOB-1; t0; t0--)
  211. !             if ((jobtab[t0].stat & STAT_INUSE) && t0 != curjob && t0 != thisjob)
  212. X                  break;
  213. X      prevjob = (t0) ? t0 : -1;
  214. X  }
  215. *** src/zsh0/zsh2.00/src/loop.c    Tue Apr 23 00:30:05 1991
  216. --- zsh2.00/src/loop.c    Fri May  3 20:52:22 1991
  217. ***************
  218. *** 30,36 ****
  219. X  */
  220. X  
  221. X  #include "zsh.h"
  222. - #include "funcs.h"
  223. X  
  224. X  int execfor(cmd) /**/
  225. X  Cmd cmd;
  226. --- 30,35 ----
  227. ***************
  228. *** 235,241 ****
  229. X  struct ifcmd *node;
  230. X  int cj = thisjob;
  231. X  
  232. -     lastval = 0;
  233. X      node = cmd->u.ifcmd;
  234. X      exiting = 0;
  235. X      while (node)
  236. --- 234,239 ----
  237. *** src/zsh0/zsh2.00/src/math.c    Wed Apr 24 00:21:22 1991
  238. --- zsh2.00/src/math.c    Fri May  3 20:52:25 1991
  239. ***************
  240. *** 31,37 ****
  241. X  */
  242. X  
  243. X  #include "zsh.h"
  244. - #include "funcs.h"
  245. X  
  246. X  static char *ptr;
  247. X  
  248. --- 31,36 ----
  249. ***************
  250. *** 54,73 ****
  251. X      RL = right-to-left associativity
  252. X      BOO = short-circuiting boolean */
  253. X  
  254. ! enum xtyp { LR,RL,BOOL };
  255. X  
  256. ! enum xtok {
  257. !     INPAR, OUTPAR, NOT, COMP, POSTPLUS,
  258. !     POSTMINUS, UPLUS, UMINUS, AND, XOR,
  259. !     OR, MUL, DIV, MOD, PLUS,
  260. !     MINUS, SHLEFT, SHRIGHT, LES, LEQ,
  261. !     GRE, GEQ, DEQ, NEQ, DAND,
  262. !     DOR, DXOR, QUEST, COLON, EQ,
  263. !     PLUSEQ, MINUSEQ, MULEQ, DIVEQ, MODEQ,
  264. !     ANDEQ, XOREQ, OREQ, SHLEFTEQ, SHRIGHTEQ,
  265. !     DANDEQ, DOREQ, DXOREQ, COMMA, EOI,
  266. !     PREPLUS, PREMINUS, NUM, ID, TOKCOUNT
  267. ! };
  268. X  
  269. X  /* precedences */
  270. X  
  271. --- 53,112 ----
  272. X      RL = right-to-left associativity
  273. X      BOO = short-circuiting boolean */
  274. X  
  275. ! #define LR 0
  276. ! #define RL 1
  277. ! #define BOOL 2
  278. X  
  279. ! #define INPAR 0
  280. ! #define OUTPAR 1
  281. ! #define NOT 2
  282. ! #define COMP 3
  283. ! #define POSTPLUS 4
  284. ! #define POSTMINUS 5
  285. ! #define UPLUS 6
  286. ! #define UMINUS 7
  287. ! #define AND 8
  288. ! #define XOR 9
  289. ! #define OR 10
  290. ! #define MUL 11
  291. ! #define DIV 12
  292. ! #define MOD 13
  293. ! #define PLUS 14
  294. ! #define MINUS 15
  295. ! #define SHLEFT 16
  296. ! #define SHRIGHT 17
  297. ! #define LES 18
  298. ! #define LEQ 19
  299. ! #define GRE 20
  300. ! #define GEQ 21
  301. ! #define DEQ 22
  302. ! #define NEQ 23
  303. ! #define DAND 24
  304. ! #define DOR 25
  305. ! #define DXOR 26
  306. ! #define QUEST 27
  307. ! #define COLON 28
  308. ! #define EQ 29
  309. ! #define PLUSEQ 30
  310. ! #define MINUSEQ 31
  311. ! #define MULEQ 32
  312. ! #define DIVEQ 33
  313. ! #define MODEQ 34
  314. ! #define ANDEQ 35
  315. ! #define XOREQ 36
  316. ! #define OREQ 37
  317. ! #define SHLEFTEQ 38
  318. ! #define SHRIGHTEQ 39
  319. ! #define DANDEQ 40
  320. ! #define DOREQ 41
  321. ! #define DXOREQ 42
  322. ! #define COMMA 43
  323. ! #define EOI 44
  324. ! #define PREPLUS 45
  325. ! #define PREMINUS 46
  326. ! #define NUM 47
  327. ! #define ID 48
  328. ! #define TOKCOUNT 49
  329. X  
  330. X  /* precedences */
  331. X  
  332. ***************
  333. *** 232,238 ****
  334. X  long setvar(s,v) /**/
  335. X  LV s;long v;
  336. X  {
  337. !     if (s == -1)
  338. X          {
  339. X          zerr("lvalue required",NULL,0);
  340. X          return 0;
  341. --- 271,277 ----
  342. X  long setvar(s,v) /**/
  343. X  LV s;long v;
  344. X  {
  345. !     if (s == -1 || s >= lvc)
  346. X          {
  347. X          zerr("lvalue required",NULL,0);
  348. X          return 0;
  349. *** src/zsh0/zsh2.00/src/params.c    Tue Apr 23 11:50:55 1991
  350. --- zsh2.00/src/params.c    Fri May  3 20:52:28 1991
  351. ***************
  352. *** 31,40 ****
  353. X  */
  354. X  
  355. X  #include "zsh.h"
  356. - #include "funcs.h"
  357. X  #include <pwd.h>
  358. X  
  359. ! #define new(X) (X=(void*)alloc(sizeof(*(X))))
  360. X  
  361. X  static Param argvparam;
  362. X  
  363. --- 31,39 ----
  364. X  */
  365. X  
  366. X  #include "zsh.h"
  367. X  #include <pwd.h>
  368. X  
  369. ! #define new(X) (X=(vptr)alloc(sizeof(*(X))))
  370. X  
  371. X  static Param argvparam;
  372. X  
  373. ***************
  374. *** 81,86 ****
  375. --- 80,86 ----
  376. X      "!",&lastpid,                /* read only */
  377. X      "$",&mypid,
  378. X      "?",&lastval,
  379. +     "status",&lastval,
  380. X      "LINENO",&lineno,
  381. X      "PPID",&ppid,
  382. X      NULL,NULL,
  383. ***************
  384. *** 109,115 ****
  385. X      "USERNAME",&username,
  386. X      NULL,NULL,
  387. X  
  388. !     "OPTARG",&optarg,        /* read/write */
  389. X      "MAIL",&mailfile,
  390. X      "prompt",&prompt,
  391. X      "PROMPT",&prompt,
  392. --- 109,116 ----
  393. X      "USERNAME",&username,
  394. X      NULL,NULL,
  395. X  
  396. !     "FCEDIT",&fceditparam,    /* read/write */
  397. !     "OPTARG",&optarg,
  398. X      "MAIL",&mailfile,
  399. X      "prompt",&prompt,
  400. X      "PROMPT",&prompt,
  401. ***************
  402. *** 265,271 ****
  403. X  static int unsetflag;
  404. X  
  405. X  struct param *createparam(name,value,flags) /**/
  406. ! char *name;void *value;int flags;
  407. X  {
  408. X  struct param *pm;
  409. X  
  410. --- 266,272 ----
  411. X  static int unsetflag;
  412. X  
  413. X  struct param *createparam(name,value,flags) /**/
  414. ! char *name;vptr value;int flags;
  415. X  {
  416. X  struct param *pm;
  417. X  
  418. ***************
  419. *** 531,547 ****
  420. X              else
  421. X                  {
  422. X                  char **ss = (v->pm->gets.afn)(v->pm);
  423. !                 int act;
  424. X  
  425. !                 act = arrlen(ss);
  426. !                 if (v->a < act)
  427. X                      {
  428. !                     free(ss[v->a]);
  429. !                     ss[v->a] = val;
  430. !                     (v->pm->sets.afn)(v->pm,ss);
  431. X                      }
  432. !                 else
  433. !                     zerr("illegal array assignment",NULL,0);
  434. X                  }
  435. X              break;
  436. X          }
  437. --- 532,553 ----
  438. X              else
  439. X                  {
  440. X                  char **ss = (v->pm->gets.afn)(v->pm);
  441. !                 int ac,ad;
  442. X  
  443. !                 if (v->a >= (ac = arrlen(ss)))
  444. X                      {
  445. !                     char **st = ss;
  446. !                     ad = v->a+1;
  447. !                     ss = zalloc((ad+1)*sizeof *ss);
  448. !                     memcpy(ss,st,(ad+1)*sizeof *ss);
  449. !                     while (ac < ad)
  450. !                         ss[ac++] = ztrdup("");
  451. !                     ss[ac] = NULL;
  452. X                      }
  453. !                 if (ss[v->a]) free(ss[v->a]);
  454. !                 ss[v->a] = val;
  455. !                 (v->pm->sets.afn)(v->pm,ss);
  456. X                  }
  457. X              break;
  458. X          }
  459. ***************
  460. *** 688,700 ****
  461. X      switch (pmtype(pm))
  462. X          {
  463. X          case 0:
  464. !             (pm->sets.cfn)(pm,NULL);
  465. X              break;
  466. X          case PMFLAG_i:
  467. X              (pm->sets.ifn)(pm,0);
  468. X              break;
  469. X          case PMFLAG_A:
  470. !             (pm->sets.afn)(pm,NULL);
  471. X              break;
  472. X          }
  473. X      if (pmtype(pm) == PMFLAG_s && (pm->flags & PMFLAG_x))
  474. --- 694,706 ----
  475. X      switch (pmtype(pm))
  476. X          {
  477. X          case 0:
  478. !             (pm->sets.cfn)(pm,ztrdup(""));
  479. X              break;
  480. X          case PMFLAG_i:
  481. X              (pm->sets.ifn)(pm,0);
  482. X              break;
  483. X          case PMFLAG_A:
  484. !             (pm->sets.afn)(pm,mkarray(NULL));
  485. X              break;
  486. X          }
  487. X      if (pmtype(pm) == PMFLAG_s && (pm->flags & PMFLAG_x))
  488. *** src/zsh0/zsh2.00/src/params.pro    Tue Apr 23 00:30:01 1991
  489. --- zsh2.00/src/params.pro    Tue May  7 22:53:28 1991
  490. ***************
  491. *** 1,5 ****
  492. X  void setupparams DCLPROTO((void));
  493. ! struct param *createparam DCLPROTO((char *name,void *value,int flags));
  494. X  int isident DCLPROTO((char *s));
  495. X  Value getvalue DCLPROTO((char **pptr,int bracks));
  496. X  char *getstrvalue DCLPROTO((Value v));
  497. --- 1,5 ----
  498. X  void setupparams DCLPROTO((void));
  499. ! struct param *createparam DCLPROTO((char *name,vptr value,int flags));
  500. X  int isident DCLPROTO((char *s));
  501. X  Value getvalue DCLPROTO((char **pptr,int bracks));
  502. X  char *getstrvalue DCLPROTO((Value v));
  503. *** src/zsh0/zsh2.00/src/parse.y    Tue Apr 23 00:30:05 1991
  504. --- zsh2.00/src/parse.y    Mon May  6 06:18:51 1991
  505. ***************
  506. *** 46,56 ****
  507. X  %right BANG
  508. X  %left OUTBRACE OUTANG OUTANGBANG DOUTANG DOUTANGBANG INANG DINANG
  509. X  %left INANGAMP OUTANGAMP OUTANGAMPBANG DOUTANGAMP DOUTANGAMPBANG
  510. ! %left TRINANG
  511. X  %left BAR BARAMP DINBRACK DOUTBRACK STRING ENVSTRING
  512. X  %left ENVARRAY ENDINPUT INOUTPAR
  513. X  %left DO DONE ESAC THEN ELIF ELSE FI FOR CASE IF WHILE
  514. X  %left FUNC REPEAT TIME UNTIL EXEC COMMAND SELECT COPROC NOGLOB DASH
  515. X  %left DOITLATER
  516. X  
  517. X  %start event
  518. --- 46,57 ----
  519. X  %right BANG
  520. X  %left OUTBRACE OUTANG OUTANGBANG DOUTANG DOUTANGBANG INANG DINANG
  521. X  %left INANGAMP OUTANGAMP OUTANGAMPBANG DOUTANGAMP DOUTANGAMPBANG
  522. ! %left TRINANG DINANGDASH
  523. X  %left BAR BARAMP DINBRACK DOUTBRACK STRING ENVSTRING
  524. X  %left ENVARRAY ENDINPUT INOUTPAR
  525. X  %left DO DONE ESAC THEN ELIF ELSE FI FOR CASE IF WHILE
  526. X  %left FUNC REPEAT TIME UNTIL EXEC COMMAND SELECT COPROC NOGLOB DASH
  527. + %left NOCORRECT
  528. X  %left DOITLATER
  529. X  
  530. X  %start event
  531. ***************
  532. *** 83,89 ****
  533. X  %type <Fnode> redir
  534. X  %type <fds> redirop BAR
  535. X  %type <fds> OUTANG OUTANGBANG DOUTANG DOUTANGBANG
  536. ! %type <fds> INANG DINANG INANGAMP OUTANGAMP TRINANG
  537. X  %type <fds> OUTANGAMPBANG DOUTANGAMP DOUTANGAMPBANG
  538. X  %type <str> STRING ENVSTRING ENVARRAY word
  539. X  %type <Table> optinword wordlist
  540. --- 84,90 ----
  541. X  %type <Fnode> redir
  542. X  %type <fds> redirop BAR
  543. X  %type <fds> OUTANG OUTANGBANG DOUTANG DOUTANGBANG
  544. ! %type <fds> INANG DINANG INANGAMP OUTANGAMP TRINANG DINANGDASH
  545. X  %type <fds> OUTANGAMPBANG DOUTANGAMP DOUTANGAMPBANG
  546. X  %type <str> STRING ENVSTRING ENVARRAY word
  547. X  %type <Table> optinword wordlist
  548. ***************
  549. *** 165,170 ****
  550. --- 166,173 ----
  551. X                          { $$ = $2; $$->flags |= CFLAG_EXEC; }
  552. X                      | NOGLOB simplecommand
  553. X                          { $$ = $2; $$->flags |= CFLAG_NOGLOB; }
  554. +                     | NOCORRECT { nocorrect = 1; } simplecommand
  555. +                         { $$ = $3; }
  556. X                      | DASH simplecommand
  557. X                          { $$ = $2; $$->flags |= CFLAG_DASH; }
  558. X                      | stufflist { $$ = $1;
  559. ***************
  560. *** 206,213 ****
  561. X                  { $$ = makecnode(SUBSH); $$->u.list = $2; }
  562. X              | INBRACE list OUTBRACE
  563. X                  { $$ = makecnode(CURSH); $$->u.list = $2; }
  564. !             | FUNC wordlist INBRACE list OUTBRACE
  565. !                 { $$ = makefuncdef($2,$4); }
  566. X              | TIME sublist2
  567. X                  { $$ = makecnode(ZCTIME); $$->u.pline = $2; }
  568. X              | DINBRACK cond DOUTBRACK
  569. --- 209,216 ----
  570. X                  { $$ = makecnode(SUBSH); $$->u.list = $2; }
  571. X              | INBRACE list OUTBRACE
  572. X                  { $$ = makecnode(CURSH); $$->u.list = $2; }
  573. !             | FUNC wordlist optbreak INBRACE list OUTBRACE
  574. !                 { $$ = makefuncdef($2,$5); }
  575. X              | TIME sublist2
  576. X                  { $$ = makecnode(ZCTIME); $$->u.pline = $2; }
  577. X              | DINBRACK cond DOUTBRACK
  578. ***************
  579. *** 249,254 ****
  580. --- 252,258 ----
  581. X              | DOUTANGBANG { $$.fd1 = $1.fd1; $$.fd2 = APPNOW; }
  582. X              | INANG { $$.fd1 = $1.fd1; $$.fd2 = READ; }
  583. X              | DINANG { $$.fd1 = $1.fd1; $$.fd2 = HEREDOC; }
  584. +             | DINANGDASH { $$.fd1 = $1.fd1; $$.fd2 = HEREDOCDASH; }
  585. X              | INANGAMP { $$.fd1 = $1.fd1; $$.fd2 = MERGE; }
  586. X              | OUTANGAMP { $$.fd1 = $1.fd1; $$.fd2 = MERGEOUT; }
  587. X              | OUTANGAMPBANG { $$.fd1 = $1.fd1; $$.fd2 = MERGEOUTNOW; }
  588. ***************
  589. *** 328,336 ****
  590. X              }
  591. X          fn->name = toks;
  592. X          }
  593. !     else if (fn->type == HEREDOC)
  594. X          {
  595. !         fn->name = gethere(toks);
  596. X          fn->type = HERESTR;
  597. X          }
  598. X      else if (fn->type >= MERGEOUT && fn->type <= ERRAPPNOW &&
  599. --- 332,340 ----
  600. X              }
  601. X          fn->name = toks;
  602. X          }
  603. !     else if (fn->type == HEREDOC || fn->type == HEREDOCDASH)
  604. X          {
  605. !         fn->name = gethere(toks,fn->type);
  606. X          fn->type = HERESTR;
  607. X          }
  608. X      else if (fn->type >= MERGEOUT && fn->type <= ERRAPPNOW &&
  609. *** src/zsh0/zsh2.00/src/subst.c    Tue Apr 23 00:30:05 1991
  610. --- zsh2.00/src/subst.c    Fri May 10 06:25:22 1991
  611. ***************
  612. *** 31,37 ****
  613. X  */
  614. X  
  615. X  #include "zsh.h"
  616. - #include "funcs.h"
  617. X  #include <pwd.h>
  618. X  
  619. X  /* do substitutions before fork */
  620. --- 31,36 ----
  621. ***************
  622. *** 68,74 ****
  623. X                  if (str[1] != Inpar)
  624. X                      if (str[1] == Inbrack)
  625. X                          {
  626. !                         arithsubst((void **) &str,&str3);    /* $[...] */
  627. X                          setdata(node,str3);
  628. X                          }
  629. X                      else
  630. --- 67,73 ----
  631. X                  if (str[1] != Inpar)
  632. X                      if (str[1] == Inbrack)
  633. X                          {
  634. !                         arithsubst((vptr*) &str,&str3);    /* $[...] */
  635. X                          setdata(node,str3);
  636. X                          }
  637. X                      else
  638. ***************
  639. *** 162,169 ****
  640. X  
  641. X  /* strdup, but returns "Nularg" if this is a null string */
  642. X  
  643. ! void *nstrdup(s) /**/
  644. ! void *s;
  645. X  {
  646. X  char *t = s;
  647. X  char u[2];
  648. --- 161,168 ----
  649. X  
  650. X  /* strdup, but returns "Nularg" if this is a null string */
  651. X  
  652. ! vptr nstrdup(s) /**/
  653. ! vptr s;
  654. X  {
  655. X  char *t = s;
  656. X  char u[2];
  657. ***************
  658. *** 257,263 ****
  659. X          char *ptr,*s,*ds;
  660. X          int val;
  661. X          
  662. -         untokenize(str);
  663. X          if (ialpha(str[1]))        /* =foo */
  664. X              {
  665. X              struct cmdnam *chn;
  666. --- 256,261 ----
  667. ***************
  668. *** 267,273 ****
  669. X              for (pp = str+1; *pp && *pp != ':'; pp++);
  670. X              sav = *pp;
  671. X              *pp = '\0';
  672. !             if ((t = gethnode(str+1,aliastab)) && t->cmd)
  673. X                  if (t->cmd >= 0)
  674. X                      cnam = strdup(t->text);
  675. X                  else
  676. --- 265,271 ----
  677. X              for (pp = str+1; *pp && *pp != ':'; pp++);
  678. X              sav = *pp;
  679. X              *pp = '\0';
  680. !             if ((t = (Alias) gethnode(str+1,aliastab)) && t->cmd)
  681. X                  if (t->cmd >= 0)
  682. X                      cnam = strdup(t->text);
  683. X                  else
  684. ***************
  685. *** 276,282 ****
  686. X                      errflag = 1;
  687. X                      return 0;
  688. X                      }
  689. !              else if (chn = gethnode(str+1,cmdnamtab))
  690. X                  if (chn->type != BUILTIN && chn->type != SHFUNC)
  691. X                      cnam = strdup(chn->u.nam);
  692. X                  else
  693. --- 274,280 ----
  694. X                      errflag = 1;
  695. X                      return 0;
  696. X                      }
  697. !              else if (chn = (Cmdnam) gethnode(str+1,cmdnamtab))
  698. X                  if (chn->type != BUILTIN && chn->type != SHFUNC)
  699. X                      cnam = strdup(chn->u.nam);
  700. X                  else
  701. ***************
  702. *** 328,333 ****
  703. --- 326,333 ----
  704. X  char sav,*str;
  705. X  struct passwd *pw;
  706. X   
  707. +     if (len == 0)
  708. +         return strdup(home);
  709. X      sav = user[len];
  710. X      user[len] = '\0';
  711. X      if (str = getsparamval(user,len))
  712. ***************
  713. *** 480,491 ****
  714. X                  case PMFLAG_l:
  715. X                      t = val;
  716. X                      for (;*t;t++)
  717. !                         *t = tolower(*t);
  718. X                      break;
  719. X                  case PMFLAG_u:
  720. X                      t = val;
  721. X                      for (;*t;t++)
  722. !                         *t = toupper(*t);
  723. X                      break;
  724. X                  }
  725. X              }
  726. --- 480,491 ----
  727. X                  case PMFLAG_l:
  728. X                      t = val;
  729. X                      for (;*t;t++)
  730. !                         *t = tulower(*t);
  731. X                      break;
  732. X                  case PMFLAG_u:
  733. X                      t = val;
  734. X                      for (;*t;t++)
  735. !                         *t = tuupper(*t);
  736. X                      break;
  737. X                  }
  738. X              }
  739. ***************
  740. *** 517,523 ****
  741. X              while (*s++);
  742. X              s--;
  743. X              }
  744. !         *s = '\0';
  745. X          if (colf && !vunset)
  746. X              vunset = !*val;
  747. X          switch (u[-1])
  748. --- 517,523 ----
  749. X              while (*s++);
  750. X              s--;
  751. X              }
  752. !         *s++ = '\0';
  753. X          if (colf && !vunset)
  754. X              vunset = !*val;
  755. X          switch (u[-1])
  756. ***************
  757. *** 638,643 ****
  758. --- 638,646 ----
  759. X              val = spacejoin(aval);
  760. X          isarr = 1;
  761. X          aval = spacesplit(val);
  762. +         /* if only one member, not really an array */
  763. +         if (!aval[1])
  764. +             isarr = 0;
  765. X          }
  766. X      if (isarr)
  767. X          if (plan9)
  768. ***************
  769. *** 688,694 ****
  770. X  /* arithmetic substitution */
  771. X  
  772. X  void arithsubst(aptr,bptr) /**/
  773. ! void **aptr;char **bptr;
  774. X  {
  775. X  char *s = *aptr,*t,buf[16];
  776. X  long v;
  777. --- 691,697 ----
  778. X  /* arithmetic substitution */
  779. X  
  780. X  void arithsubst(aptr,bptr) /**/
  781. ! vptr *aptr;char **bptr;
  782. X  {
  783. X  char *s = *aptr,*t,buf[16];
  784. X  long v;
  785. ***************
  786. *** 785,791 ****
  787. X  struct alias *mkanode(txt,cmflag) /**/
  788. X  char *txt;int cmflag;
  789. X  {
  790. ! struct alias *ptr = (void *) zcalloc(sizeof *ptr);
  791. X  
  792. X      ptr->text  = txt;
  793. X      ptr->cmd = cmflag;
  794. --- 788,794 ----
  795. X  struct alias *mkanode(txt,cmflag) /**/
  796. X  char *txt;int cmflag;
  797. X  {
  798. ! struct alias *ptr = (Alias) zcalloc(sizeof *ptr);
  799. X  
  800. X      ptr->text  = txt;
  801. X      ptr->cmd = cmflag;
  802. *** src/zsh0/zsh2.00/src/table.c    Tue Apr 23 00:30:05 1991
  803. --- zsh2.00/src/table.c    Fri May  3 20:52:32 1991
  804. ***************
  805. *** 32,38 ****
  806. X  
  807. X  #define TABLE_C
  808. X  #include "zsh.h"
  809. - #include "funcs.h"
  810. X  
  811. X  /* get an empty linked list header */
  812. X  
  813. --- 32,37 ----
  814. ***************
  815. *** 40,46 ****
  816. X  {
  817. X  Lklist list;
  818. X   
  819. !     list = alloc(sizeof *list);
  820. X      list->first = 0;
  821. X      list->last = (Lknode) list;
  822. X      return list;
  823. --- 39,45 ----
  824. X  {
  825. X  Lklist list;
  826. X   
  827. !     list = (Lklist) alloc(sizeof *list);
  828. X      list->first = 0;
  829. X      list->last = (Lknode) list;
  830. X      return list;
  831. ***************
  832. *** 53,61 ****
  833. X  {
  834. X  Hashtab ret;
  835. X   
  836. !     ret = zcalloc(sizeof *ret);
  837. X      ret->hsize = size;
  838. !     ret->nodes = zcalloc(size*sizeof(Hashnode));
  839. X      return ret;
  840. X  }
  841. X   
  842. --- 52,60 ----
  843. X  {
  844. X  Hashtab ret;
  845. X   
  846. !     ret = (Hashtab) zcalloc(sizeof *ret);
  847. X      ret->hsize = size;
  848. !     ret->nodes = (Hashnode*) zcalloc(size*sizeof(Hashnode));
  849. X      return ret;
  850. X  }
  851. X   
  852. ***************
  853. *** 81,87 ****
  854. X  /* add a node to a hash table */
  855. X  
  856. X  void Addhnode(nam,dat,ht,freefunc,canfree) /**/
  857. ! char *nam;void *dat;Hashtab ht;FFunc freefunc;int canfree;
  858. X  {
  859. X  int hval = hasher(nam) % ht->hsize;
  860. X  struct hashnode *hp = ht->nodes[hval],*hn;
  861. --- 80,86 ----
  862. X  /* add a node to a hash table */
  863. X  
  864. X  void Addhnode(nam,dat,ht,freefunc,canfree) /**/
  865. ! char *nam;vptr dat;Hashtab ht;FFunc freefunc;int canfree;
  866. X  {
  867. X  int hval = hasher(nam) % ht->hsize;
  868. X  struct hashnode *hp = ht->nodes[hval],*hn;
  869. ***************
  870. *** 102,108 ****
  871. X              hp->canfree = canfree;
  872. X              return;
  873. X              }
  874. !     hn = (void *) zcalloc(sizeof *hn);
  875. X      hn->nam = nam;
  876. X      hn->dat = dat;
  877. X      hn->canfree = canfree;
  878. --- 101,107 ----
  879. X              hp->canfree = canfree;
  880. X              return;
  881. X              }
  882. !     hn = (Hashnode) zcalloc(sizeof *hn);
  883. X      hn->nam = nam;
  884. X      hn->dat = dat;
  885. X      hn->canfree = canfree;
  886. ***************
  887. *** 122,128 ****
  888. X  
  889. X      ht->hsize = nsize;
  890. X      arr = ht->nodes;
  891. !     ht->nodes = zcalloc(nsize*sizeof(struct hashnode *));
  892. X      for (ha = arr; osize; osize--,ha++)
  893. X          for (hn = *ha; hn; )
  894. X              {
  895. --- 121,127 ----
  896. X  
  897. X      ht->hsize = nsize;
  898. X      arr = ht->nodes;
  899. !     ht->nodes = (Hashnode*) zcalloc(nsize*sizeof(struct hashnode *));
  900. X      for (ha = arr; osize; osize--,ha++)
  901. X          for (hn = *ha; hn; )
  902. X              {
  903. ***************
  904. *** 136,142 ****
  905. X  
  906. X  /* get an entry in a hash table */
  907. X  
  908. ! void *gethnode(nam,ht) /**/
  909. X  char *nam;Hashtab ht;
  910. X  {
  911. X  int hval = hasher(nam) % ht->hsize;
  912. --- 135,141 ----
  913. X  
  914. X  /* get an entry in a hash table */
  915. X  
  916. ! vptr gethnode(nam,ht) /**/
  917. X  char *nam;Hashtab ht;
  918. X  {
  919. X  int hval = hasher(nam) % ht->hsize;
  920. ***************
  921. *** 166,177 ****
  922. X  
  923. X  /* remove a hash table entry and return a pointer to it */
  924. X  
  925. ! void *remhnode(nam,ht) /**/
  926. X  char *nam;Hashtab ht;
  927. X  {
  928. X  int hval = hasher(nam) % ht->hsize;
  929. X  struct hashnode *hn = ht->nodes[hval],*hp;
  930. ! void *dat;
  931. X  
  932. X      if (!hn)
  933. X          return NULL;
  934. --- 165,176 ----
  935. X  
  936. X  /* remove a hash table entry and return a pointer to it */
  937. X  
  938. ! vptr remhnode(nam,ht) /**/
  939. X  char *nam;Hashtab ht;
  940. X  {
  941. X  int hval = hasher(nam) % ht->hsize;
  942. X  struct hashnode *hn = ht->nodes[hval],*hp;
  943. ! vptr dat;
  944. X  
  945. X      if (!hn)
  946. X          return NULL;
  947. ***************
  948. *** 202,213 ****
  949. X  /* insert a node in a linked list after 'llast' */
  950. X  
  951. X  void insnode(list,llast,dat) /**/
  952. ! Lklist list;Lknode llast;void *dat;
  953. X  {
  954. X  Lknode tmp;
  955. X   
  956. X      tmp = llast->next;
  957. !     llast->next = alloc(sizeof *tmp);
  958. X      llast->next->last = llast;
  959. X      llast->next->dat = dat;
  960. X      llast->next->next = tmp;
  961. --- 201,212 ----
  962. X  /* insert a node in a linked list after 'llast' */
  963. X  
  964. X  void insnode(list,llast,dat) /**/
  965. ! Lklist list;Lknode llast;vptr dat;
  966. X  {
  967. X  Lknode tmp;
  968. X   
  969. X      tmp = llast->next;
  970. !     llast->next = (Lknode) alloc(sizeof *tmp);
  971. X      llast->next->last = llast;
  972. X      llast->next->dat = dat;
  973. X      llast->next->next = tmp;
  974. ***************
  975. *** 217,228 ****
  976. X          list->last = llast->next;
  977. X  }
  978. X  
  979. X  /* remove a node from a linked list */
  980. X  
  981. ! void *remnode(list,nd) /**/
  982. X  Lklist list;Lknode nd;
  983. X  {
  984. ! void *dat;
  985. X  
  986. X      nd->last->next = nd->next;
  987. X      if (nd->next)
  988. --- 216,244 ----
  989. X          list->last = llast->next;
  990. X  }
  991. X  
  992. + void addnodeinorder(x,dat) /**/
  993. + Lklist x; char *dat;
  994. + {
  995. + Lknode y, l = NULL;
  996. +     for (y = firstnode(x); y; incnode(y)) {
  997. +         if (forstrcmp(&y->dat, &dat) >= 0) 
  998. +             break;
  999. +         l = y;
  1000. +     }
  1001. +     if (l == NULL)
  1002. +         insnode(x, x, dat);
  1003. +     else
  1004. +         insnode(x, l, dat);
  1005. + }
  1006. X  /* remove a node from a linked list */
  1007. X  
  1008. ! vptr remnode(list,nd) /**/
  1009. X  Lklist list;Lknode nd;
  1010. X  {
  1011. ! vptr dat;
  1012. X  
  1013. X      nd->last->next = nd->next;
  1014. X      if (nd->next)
  1015. ***************
  1016. *** 236,245 ****
  1017. X  
  1018. X  /* remove a node from a linked list */
  1019. X  
  1020. ! void *uremnode(list,nd) /**/
  1021. X  Lklist list;Lknode nd;
  1022. X  {
  1023. ! void *dat;
  1024. X  
  1025. X      nd->last->next = nd->next;
  1026. X      if (nd->next)
  1027. --- 252,261 ----
  1028. X  
  1029. X  /* remove a node from a linked list */
  1030. X  
  1031. ! vptr uremnode(list,nd) /**/
  1032. X  Lklist list;Lknode nd;
  1033. X  {
  1034. ! vptr dat;
  1035. X  
  1036. X      nd->last->next = nd->next;
  1037. X      if (nd->next)
  1038. ***************
  1039. *** 261,270 ****
  1040. X  
  1041. X  /* get top node in a linked list */
  1042. X  
  1043. ! void *getnode(list) /**/
  1044. X  Lklist list;
  1045. X  {
  1046. ! void *dat;
  1047. X  Lknode node = list->first;
  1048. X   
  1049. X      if (!node)
  1050. --- 277,286 ----
  1051. X  
  1052. X  /* get top node in a linked list */
  1053. X  
  1054. ! vptr getnode(list) /**/
  1055. X  Lklist list;
  1056. X  {
  1057. ! vptr dat;
  1058. X  Lknode node = list->first;
  1059. X   
  1060. X      if (!node)
  1061. ***************
  1062. *** 281,290 ****
  1063. X  
  1064. X  /* get top node in a linked list without freeing */
  1065. X  
  1066. ! void *ugetnode(list) /**/
  1067. X  Lklist list;
  1068. X  {
  1069. ! void *dat;
  1070. X  Lknode node = list->first;
  1071. X   
  1072. X      if (!node)
  1073. --- 297,306 ----
  1074. X  
  1075. X  /* get top node in a linked list without freeing */
  1076. X  
  1077. ! vptr ugetnode(list) /**/
  1078. X  Lklist list;
  1079. X  {
  1080. ! vptr dat;
  1081. X  Lknode node = list->first;
  1082. X   
  1083. X      if (!node)
  1084. *** src/zsh0/zsh2.00/src/text.c    Tue Apr 23 00:30:05 1991
  1085. --- zsh2.00/src/text.c    Fri May  3 20:52:34 1991
  1086. ***************
  1087. *** 31,37 ****
  1088. X  */
  1089. X  
  1090. X  #include "zsh.h"
  1091. - #include "funcs.h"
  1092. X  
  1093. X  static char *tptr,*tbuf,*tlim;
  1094. X  static int tsiz,tindent,tnewlins;
  1095. --- 31,36 ----
  1096. *** src/zsh0/zsh2.00/src/utils.c    Tue Apr 23 11:42:30 1991
  1097. --- zsh2.00/src/utils.c    Tue May  7 23:02:59 1991
  1098. ***************
  1099. *** 30,36 ****
  1100. X  */
  1101. X  
  1102. X  #include "zsh.h"
  1103. - #include "funcs.h"
  1104. X  #include <pwd.h>
  1105. X  #include <errno.h>
  1106. X  #include <sys/dir.h>
  1107. --- 30,35 ----
  1108. ***************
  1109. *** 126,133 ****
  1110. X                          errflag = 1;
  1111. X                          return;
  1112. X                          }
  1113. !                     fputc(tolower(sys_errlist[num][0]),stderr);
  1114. !                     fputs(sys_errlist[num]+1,stderr);
  1115. X                      break;
  1116. X                  }
  1117. X              }
  1118. --- 125,137 ----
  1119. X                          errflag = 1;
  1120. X                          return;
  1121. X                          }
  1122. !                     if (num == EIO)
  1123. !                         fputs(sys_errlist[num],stderr);
  1124. !                     else
  1125. !                         {
  1126. !                         fputc(tulower(sys_errlist[num][0]),stderr);
  1127. !                         fputs(sys_errlist[num]+1,stderr);
  1128. !                         }
  1129. X                      break;
  1130. X                  }
  1131. X              }
  1132. ***************
  1133. *** 156,167 ****
  1134. X  {
  1135. X      if (itok(c))
  1136. X          {
  1137. !         if (c >= Pound && c <= Qtick)
  1138. X              putc(ztokens[c-Pound],f);
  1139. X          return;
  1140. X          }
  1141. X      c &= 0x7f;
  1142. !     if (c >= ' ' && c < '\x7f')
  1143. X          putc(c,f);
  1144. X      else if (c == '\n')
  1145. X          {
  1146. --- 160,171 ----
  1147. X  {
  1148. X      if (itok(c))
  1149. X          {
  1150. !         if (c >= Pound && c <= Comma)
  1151. X              putc(ztokens[c-Pound],f);
  1152. X          return;
  1153. X          }
  1154. X      c &= 0x7f;
  1155. !     if (c >= ' ' && c < 0x7f)
  1156. X          putc(c,f);
  1157. X      else if (c == '\n')
  1158. X          {
  1159. ***************
  1160. *** 626,632 ****
  1161. X                      ct++;
  1162. X                      }
  1163. X                  closedir(lock);
  1164. !                 ap = arr = alloc(ct*sizeof(char *));
  1165. X                  while (*ap++ = ugetnode(l));
  1166. X                  checkmailpath(arr);
  1167. X                  popheap();
  1168. --- 630,636 ----
  1169. X                      ct++;
  1170. X                      }
  1171. X                  closedir(lock);
  1172. !                 ap = arr = (char **) alloc(ct*sizeof(char *));
  1173. X                  while (*ap++ = ugetnode(l));
  1174. X                  checkmailpath(arr);
  1175. X                  popheap();
  1176. ***************
  1177. *** 675,681 ****
  1178. X  
  1179. X      if (y->type == SHFUNC)
  1180. X          {
  1181. !         cc = zcalloc(sizeof *cc);
  1182. X          *cc = *y;
  1183. X          y->u.list = NULL;
  1184. X          addhnode(ztrdup(x),cc,cmdnamtab,freecmdnam);
  1185. --- 679,685 ----
  1186. X  
  1187. X      if (y->type == SHFUNC)
  1188. X          {
  1189. !         cc = (Cmdnam) zcalloc(sizeof *cc);
  1190. X          *cc = *y;
  1191. X          y->u.list = NULL;
  1192. X          addhnode(ztrdup(x),cc,cmdnamtab,freecmdnam);
  1193. ***************
  1194. *** 724,730 ****
  1195. X              readdir(dir); readdir(dir);
  1196. X              while (de = readdir(dir))
  1197. X                  {
  1198. !                 cc = zcalloc(sizeof *cc);
  1199. X                  cc->type = (dot) ? EXCMD_POSTDOT : EXCMD_PREDOT;
  1200. X                  cc->u.nam = tricat(path[t0],"/",de->d_name);
  1201. X                  addhnode(ztrdup(de->d_name),cc,cmdnamtab,freecmdnam);
  1202. --- 728,734 ----
  1203. X              readdir(dir); readdir(dir);
  1204. X              while (de = readdir(dir))
  1205. X                  {
  1206. !                 cc = (Cmdnam) zcalloc(sizeof *cc);
  1207. X                  cc->type = (dot) ? EXCMD_POSTDOT : EXCMD_PREDOT;
  1208. X                  cc->u.nam = tricat(path[t0],"/",de->d_name);
  1209. X                  addhnode(ztrdup(de->d_name),cc,cmdnamtab,freecmdnam);
  1210. ***************
  1211. *** 742,748 ****
  1212. X  }
  1213. X  
  1214. X  void freecmdnam(a) /**/
  1215. ! void *a;
  1216. X  {
  1217. X  struct cmdnam *c = (struct cmdnam *) a;
  1218. X  
  1219. --- 746,752 ----
  1220. X  }
  1221. X  
  1222. X  void freecmdnam(a) /**/
  1223. ! vptr a;
  1224. X  {
  1225. X  struct cmdnam *c = (struct cmdnam *) a;
  1226. X  
  1227. ***************
  1228. *** 757,769 ****
  1229. X  }
  1230. X  
  1231. X  void freestr(a) /**/
  1232. ! void *a;
  1233. X  {
  1234. X      free(a);
  1235. X  }
  1236. X  
  1237. X  void freeanode(a) /**/
  1238. ! void *a;
  1239. X  {
  1240. X  struct alias *c = (struct alias *) a;
  1241. X  
  1242. --- 761,773 ----
  1243. X  }
  1244. X  
  1245. X  void freestr(a) /**/
  1246. ! vptr a;
  1247. X  {
  1248. X      free(a);
  1249. X  }
  1250. X  
  1251. X  void freeanode(a) /**/
  1252. ! vptr a;
  1253. X  {
  1254. X  struct alias *c = (struct alias *) a;
  1255. X  
  1256. ***************
  1257. *** 772,780 ****
  1258. X  }
  1259. X  
  1260. X  void freepm(a) /**/
  1261. ! void *a;
  1262. X  {
  1263. ! struct param *pm = a;
  1264. X  
  1265. X      free(pm);
  1266. X  }
  1267. --- 776,784 ----
  1268. X  }
  1269. X  
  1270. X  void freepm(a) /**/
  1271. ! vptr a;
  1272. X  {
  1273. ! struct param *pm = (Param) a;
  1274. X  
  1275. X      free(pm);
  1276. X  }
  1277. ***************
  1278. *** 787,807 ****
  1279. X  void gettyinfo(ti) /**/
  1280. X  struct ttyinfo *ti;
  1281. X  {
  1282. !     if (jobbing)
  1283. X          {
  1284. X  #ifdef TERMIOS
  1285. !         ioctl(SHTTY,TCGETS,&ti->termios);
  1286. X  #else
  1287. X  #ifdef TERMIO
  1288. X          ioctl(SHTTY,TCGETA,&ti->termio);
  1289. X  #else
  1290. X          ioctl(SHTTY,TIOCGETP,&ti->sgttyb);
  1291. X          ioctl(SHTTY,TIOCGETC,&ti->tchars);
  1292. X          ioctl(SHTTY,TIOCGLTC,&ti->ltchars);
  1293. X  #endif
  1294. X  #endif
  1295. X  #ifdef TIOCGWINSZ
  1296. !         ioctl(SHTTY,TIOCGWINSZ,&ti->winsize);
  1297. X  #endif
  1298. X          }
  1299. X  }
  1300. --- 791,814 ----
  1301. X  void gettyinfo(ti) /**/
  1302. X  struct ttyinfo *ti;
  1303. X  {
  1304. !     if (SHTTY != -1)
  1305. X          {
  1306. X  #ifdef TERMIOS
  1307. !         if (ioctl(SHTTY,TCGETS,&ti->termios) == -1)
  1308. !             zerr("bad tcgets: %e",NULL,errno);
  1309. X  #else
  1310. X  #ifdef TERMIO
  1311. X          ioctl(SHTTY,TCGETA,&ti->termio);
  1312. X  #else
  1313. X          ioctl(SHTTY,TIOCGETP,&ti->sgttyb);
  1314. +         ioctl(SHTTY,TIOCLGET,&ti->lmodes);
  1315. X          ioctl(SHTTY,TIOCGETC,&ti->tchars);
  1316. X          ioctl(SHTTY,TIOCGLTC,&ti->ltchars);
  1317. X  #endif
  1318. X  #endif
  1319. X  #ifdef TIOCGWINSZ
  1320. !         if (ioctl(SHTTY,TIOCGWINSZ,&ti->winsize) == -1)
  1321. !             zerr("bad tiocgwinsz: %e",NULL,errno);
  1322. X  #endif
  1323. X          }
  1324. X  }
  1325. ***************
  1326. *** 809,823 ****
  1327. X  void settyinfo(ti) /**/
  1328. X  struct ttyinfo *ti;
  1329. X  {
  1330. !     if (jobbing)
  1331. X          {
  1332. X  #ifdef TERMIOS
  1333. !         ioctl(SHTTY,TCSETS,&ti->termios);
  1334. X  #else
  1335. X  #ifdef TERMIO
  1336. X          ioctl(SHTTY,TCSETA,&ti->termio);
  1337. X  #else
  1338. X          ioctl(SHTTY,TIOCSETN,&ti->sgttyb);
  1339. X          ioctl(SHTTY,TIOCSETC,&ti->tchars);
  1340. X          ioctl(SHTTY,TIOCSLTC,&ti->ltchars);
  1341. X  #endif
  1342. --- 816,832 ----
  1343. X  void settyinfo(ti) /**/
  1344. X  struct ttyinfo *ti;
  1345. X  {
  1346. !     if (SHTTY != -1)
  1347. X          {
  1348. X  #ifdef TERMIOS
  1349. !         if (ioctl(SHTTY,TCSETS,&ti->termios) == -1)
  1350. !             zerr("settyinfo: %e",NULL,errno);
  1351. X  #else
  1352. X  #ifdef TERMIO
  1353. X          ioctl(SHTTY,TCSETA,&ti->termio);
  1354. X  #else
  1355. X          ioctl(SHTTY,TIOCSETN,&ti->sgttyb);
  1356. +         ioctl(SHTTY,TIOCLSET,&ti->lmodes);
  1357. X          ioctl(SHTTY,TIOCSETC,&ti->tchars);
  1358. X          ioctl(SHTTY,TIOCSLTC,&ti->ltchars);
  1359. X  #endif
  1360. ***************
  1361. *** 824,835 ****
  1362. X  #endif
  1363. X  #ifdef TIOCGWINSZ
  1364. X          signal(SIGWINCH,SIG_IGN);
  1365. !         ioctl(SHTTY,TIOCSWINSZ,&ti->winsize);
  1366. X          signal(SIGWINCH,handler);
  1367. X  #endif
  1368. X          }
  1369. X  }
  1370. X  
  1371. X  void adjustwinsize() /**/
  1372. X  {
  1373. X  #ifdef TIOCGWINSZ
  1374. --- 833,876 ----
  1375. X  #endif
  1376. X  #ifdef TIOCGWINSZ
  1377. X          signal(SIGWINCH,SIG_IGN);
  1378. !         if (ioctl(SHTTY,TIOCSWINSZ,&ti->winsize) == -1)
  1379. !             zerr("settyinfo: %e",NULL,errno);
  1380. X          signal(SIGWINCH,handler);
  1381. X  #endif
  1382. X          }
  1383. X  }
  1384. X  
  1385. + #define SANEKEY(X) \
  1386. +     if (ti->X == -1 && savedttyinfo.X != -1) ti->X = savedttyinfo.X;
  1387. + void sanetty(ti) /**/
  1388. + struct ttyinfo *ti;
  1389. + {
  1390. + int t0;
  1391. + #ifdef TERMIOS
  1392. +     ti->termios.c_lflag |= ICANON|ECHO;
  1393. +     for (t0 = 0; t0 != NCCS; t0++)
  1394. +         if (!ti->termios.c_cc[t0] && savedttyinfo.termios.c_cc[t0])
  1395. +             ti->termios.c_cc[t0] = savedttyinfo.termios.c_cc[t0];
  1396. + #else
  1397. + #ifdef TERMIO
  1398. +     ti->termio.c_lflag |= ICANON|ECHO;
  1399. +     for (t0 = 0; t0 != NCC; t0++)
  1400. +         if (!ti->termio.c_cc[t0] && savedttyinfo.termio.c_cc[t0])
  1401. +             ti->termio.c_cc[t0] = savedttyinfo.termio.c_cc[t0];
  1402. + #else
  1403. +     ti->sgttyb.sg_flags = (ti->sgttyb.sg_flags & ~CBREAK) | ECHO;
  1404. +     SANEKEY(tchars.t_quitc);
  1405. +     SANEKEY(tchars.t_startc);
  1406. +     SANEKEY(tchars.t_stopc);
  1407. +     SANEKEY(ltchars.t_suspc);
  1408. +     SANEKEY(ltchars.t_dsuspc);
  1409. +     SANEKEY(ltchars.t_lnextc);
  1410. + #endif
  1411. + #endif
  1412. + }
  1413. X  void adjustwinsize() /**/
  1414. X  {
  1415. X  #ifdef TIOCGWINSZ
  1416. ***************
  1417. *** 963,969 ****
  1418. X              signal(t0,handler);
  1419. X          sigtrapped[t0] = 1;
  1420. X          permalloc();
  1421. !         sigfuncs[t0] = dupstruct(l);
  1422. X          heapalloc();
  1423. X          }
  1424. X  }
  1425. --- 1004,1010 ----
  1426. X              signal(t0,handler);
  1427. X          sigtrapped[t0] = 1;
  1428. X          permalloc();
  1429. !         sigfuncs[t0] = (List) dupstruct(l);
  1430. X          heapalloc();
  1431. X          }
  1432. X  }
  1433. ***************
  1434. *** 1068,1075 ****
  1435. X  
  1436. X  /* spellcheck a word */
  1437. X  
  1438. ! void spckword(s,cmd) /**/
  1439. ! char **s;int cmd;
  1440. X  {
  1441. X  char *t,*u;
  1442. X  int x;
  1443. --- 1109,1116 ----
  1444. X  
  1445. X  /* spellcheck a word */
  1446. X  
  1447. ! void spckword(s,s2,cmd,ask) /**/
  1448. ! char **s;char **s2;int cmd;int ask;
  1449. X  {
  1450. X  char *t,*u;
  1451. X  int x;
  1452. ***************
  1453. *** 1100,1111 ****
  1454. X          }
  1455. X      if (best && strlen(best) > 1)
  1456. X          {
  1457. !         fprintf(stderr,"zsh: correct to `%s' (y/n)? ",best);
  1458. !         fflush(stderr);
  1459. !         feep();
  1460. !         x = getquery();
  1461. X          if (x == 'y')
  1462. X              *s = strdup(best);
  1463. X          }
  1464. X  }
  1465. X  
  1466. --- 1141,1160 ----
  1467. X          }
  1468. X      if (best && strlen(best) > 1)
  1469. X          {
  1470. !         if (ask) {
  1471. !             fprintf(stderr,"zsh: correct to `%s' (y/n)? ",best);
  1472. !             fflush(stderr);
  1473. !             feep();
  1474. !             x = getquery();
  1475. !         }
  1476. !         else
  1477. !             x = 'y';
  1478. X          if (x == 'y')
  1479. +             {
  1480. X              *s = strdup(best);
  1481. +             if (s2)
  1482. +                 *s2 = strdup(best);
  1483. +             }
  1484. X          }
  1485. X  }
  1486. X  
  1487. ***************
  1488. *** 1245,1251 ****
  1489. X      t = s;
  1490. X      do
  1491. X          {
  1492. !         for (s = t; *t && !iblank(*t); t++);
  1493. X          *ptr = zalloc((t-s)+1);
  1494. X          strncpy(*ptr,s,(t-s)+1);
  1495. X          (*ptr++)[t-s] = '\0';
  1496. --- 1294,1300 ----
  1497. X      t = s;
  1498. X      do
  1499. X          {
  1500. !         for (s = t; *t && !inblank(*t); t++);
  1501. X          *ptr = zalloc((t-s)+1);
  1502. X          strncpy(*ptr,s,(t-s)+1);
  1503. X          (*ptr++)[t-s] = '\0';
  1504. ***************
  1505. *** 1258,1264 ****
  1506. X  List getshfunc(nam) /**/
  1507. X  char *nam;
  1508. X  {
  1509. ! Cmdnam x = gethnode(nam,cmdnamtab);
  1510. X  
  1511. X      return (x && x->type == SHFUNC) ? x->u.list : NULL;
  1512. X  }
  1513. --- 1307,1313 ----
  1514. X  List getshfunc(nam) /**/
  1515. X  char *nam;
  1516. X  {
  1517. ! Cmdnam x = (Cmdnam) gethnode(nam,cmdnamtab);
  1518. X  
  1519. X      return (x && x->type == SHFUNC) ? x->u.list : NULL;
  1520. X  }
  1521. ***************
  1522. *** 1265,1275 ****
  1523. X  
  1524. X  /* allocate a tree element */
  1525. X  
  1526. ! void *allocnode(type) /**/
  1527. X  int type;
  1528. X  {
  1529. X  int t0;
  1530. ! struct node *n = alloc(sizeof *n);
  1531. X  static int typetab[N_COUNT][4] = {
  1532. X      NT_NODE,NT_NODE,0,0,
  1533. X      NT_NODE,NT_NODE,0,0,
  1534. --- 1314,1324 ----
  1535. X  
  1536. X  /* allocate a tree element */
  1537. X  
  1538. ! vptr allocnode(type) /**/
  1539. X  int type;
  1540. X  {
  1541. X  int t0;
  1542. ! struct node *n = (struct node *) alloc(sizeof *n);
  1543. X  static int typetab[N_COUNT][4] = {
  1544. X      NT_NODE,NT_NODE,0,0,
  1545. X      NT_NODE,NT_NODE,0,0,
  1546. ***************
  1547. *** 1287,1299 ****
  1548. X      n->type = type;
  1549. X      for (t0 = 0; t0 != 4; t0++)
  1550. X          n->types[t0] = typetab[type][t0];
  1551. !     return n;
  1552. X  }
  1553. X  
  1554. X  /* duplicate a syntax tree */
  1555. X  
  1556. ! void *dupstruct(a) /**/
  1557. ! void *a;
  1558. X  {
  1559. X  struct node *n = a,*m;
  1560. X  int t0;
  1561. --- 1336,1348 ----
  1562. X      n->type = type;
  1563. X      for (t0 = 0; t0 != 4; t0++)
  1564. X          n->types[t0] = typetab[type][t0];
  1565. !     return (vptr) n;
  1566. X  }
  1567. X  
  1568. X  /* duplicate a syntax tree */
  1569. X  
  1570. ! vptr dupstruct(a) /**/
  1571. ! vptr a;
  1572. X  {
  1573. X  struct node *n = a,*m;
  1574. X  int t0;
  1575. ***************
  1576. *** 1314,1328 ****
  1577. X                          ((useheap) ? strdup : ztrdup));
  1578. X                      break;
  1579. X                  }
  1580. !     return (void *) m;
  1581. X  }
  1582. X  
  1583. X  /* free a syntax tree */
  1584. X  
  1585. X  void freestruct(a) /**/
  1586. ! void *a;
  1587. X  {
  1588. ! struct node *n = a;
  1589. X  int t0;
  1590. X  
  1591. X      for (t0 = 0; t0 != 4; t0++)
  1592. --- 1363,1377 ----
  1593. X                          ((useheap) ? strdup : ztrdup));
  1594. X                      break;
  1595. X                  }
  1596. !     return (vptr) m;
  1597. X  }
  1598. X  
  1599. X  /* free a syntax tree */
  1600. X  
  1601. X  void freestruct(a) /**/
  1602. ! vptr a;
  1603. X  {
  1604. ! struct node *n = (struct node *) a;
  1605. X  int t0;
  1606. X  
  1607. X      for (t0 = 0; t0 != 4; t0++)
  1608. ***************
  1609. *** 1424,1430 ****
  1610. X          typtab[t0] = IDIGIT|IALNUM|IWORD|IIDENT|IUSER;
  1611. X      for (t0 = 'a'; t0 <= 'z'; t0++)
  1612. X          typtab[t0] = typtab[t0-'a'+'A'] = IALPHA|IALNUM|IIDENT|IUSER|IWORD;
  1613. !     typtab['_'] = IIDENT;
  1614. X      typtab['-'] = IUSER;
  1615. X      typtab[' '] |= IBLANK|INBLANK;
  1616. X      typtab['\t'] |= IBLANK|INBLANK;
  1617. --- 1473,1481 ----
  1618. X          typtab[t0] = IDIGIT|IALNUM|IWORD|IIDENT|IUSER;
  1619. X      for (t0 = 'a'; t0 <= 'z'; t0++)
  1620. X          typtab[t0] = typtab[t0-'a'+'A'] = IALPHA|IALNUM|IIDENT|IUSER|IWORD;
  1621. !     for (t0 = 0240; t0 != 0400; t0++)
  1622. !         typtab[t0] = IALPHA|IALNUM|IIDENT|IUSER|IWORD;
  1623. !     typtab['_'] = IIDENT|IUSER;
  1624. X      typtab['-'] = IUSER;
  1625. X      typtab[' '] |= IBLANK|INBLANK;
  1626. X      typtab['\t'] |= IBLANK|INBLANK;
  1627. ***************
  1628. *** 1446,1452 ****
  1629. X  {
  1630. X  char **x,**y;
  1631. X  
  1632. !     y = x = ncalloc(sizeof(char *)*(arrlen(s)+1));
  1633. X      while (*x++ = strdup(*s++));
  1634. X      return y;
  1635. X  }
  1636. --- 1497,1503 ----
  1637. X  {
  1638. X  char **x,**y;
  1639. X  
  1640. !     y = x = (char **) ncalloc(sizeof(char *)*(arrlen(s)+1));
  1641. X      while (*x++ = strdup(*s++));
  1642. X      return y;
  1643. X  }
  1644. ***************
  1645. *** 1527,1539 ****
  1646. X      if (!strcmp(s,t))
  1647. X          return 0;
  1648. X      /* any number of upper/lower mistakes allowed (dist = 1) */
  1649. !     for (p = s, q = t; *p && tolower(*p) == tolower(*q); p++,q++);
  1650. X      if (!*p && !*q)
  1651. X          return 1;
  1652. X      if (!thresh)
  1653. X          return 200;
  1654. X      for (p = s, q = t; *p && *q; p++,q++)
  1655. !         if (p[1] == q[0] && q[1] == p[0])  /* transpositions */
  1656. X              return spdist(p+2,q+2,thresh-1)+1;
  1657. X          else if (p[1] == q[0])    /* missing letter */
  1658. X              return spdist(p+1,q+0,thresh-1)+2;
  1659. --- 1578,1591 ----
  1660. X      if (!strcmp(s,t))
  1661. X          return 0;
  1662. X      /* any number of upper/lower mistakes allowed (dist = 1) */
  1663. !     for (p = s, q = t; *p && tulower(*p) == tulower(*q); p++,q++);
  1664. X      if (!*p && !*q)
  1665. X          return 1;
  1666. X      if (!thresh)
  1667. X          return 200;
  1668. X      for (p = s, q = t; *p && *q; p++,q++)
  1669. !         if (*p == *q) continue;    /* don't consider "aa" transposed, ash */
  1670. !         else if (p[1] == q[0] && q[1] == p[0])  /* transpositions */
  1671. X              return spdist(p+2,q+2,thresh-1)+1;
  1672. X          else if (p[1] == q[0])    /* missing letter */
  1673. X              return spdist(p+1,q+0,thresh-1)+2;
  1674. ***************
  1675. *** 1579,1583 ****
  1676. --- 1631,1647 ----
  1677. X              return p+1;
  1678. X          }
  1679. X      return NULL;
  1680. + }
  1681. + int tulower(c) /**/
  1682. + int c;
  1683. + {
  1684. +     return (c >= 'A' && c <= 'Z') ? c-'A'+'a' : c;
  1685. + }
  1686. + int tuupper(c) /**/
  1687. + int c;
  1688. + {
  1689. +     return (c >= 'a' && c <= 'z') ? c-'a'+'A' : c;
  1690. X  }
  1691. X  
  1692. *** src/zsh0/zsh2.00/src/watch.c    Tue Apr 23 00:30:05 1991
  1693. --- zsh2.00/src/watch.c    Wed May  8 21:48:28 1991
  1694. ***************
  1695. *** 31,37 ****
  1696. X  */
  1697. X  
  1698. X  #include "zsh.h"
  1699. - #include "funcs.h"
  1700. X  #include <utmp.h>
  1701. X  
  1702. X  static int wtabsz;
  1703. --- 31,36 ----
  1704. ***************
  1705. *** 285,291 ****
  1706. X              {
  1707. X              uptr++;
  1708. X              if (++wtabsz == wtabmax)
  1709. !                 uptr = (wtab = (struct utmp *) realloc((void *) wtab,(wtabmax*=2)*
  1710. X                      sizeof(struct utmp)))+wtabsz;
  1711. X              }
  1712. X      fclose(in);
  1713. --- 284,290 ----
  1714. X              {
  1715. X              uptr++;
  1716. X              if (++wtabsz == wtabmax)
  1717. !                 uptr = (wtab = (struct utmp *) realloc((vptr) wtab,(wtabmax*=2)*
  1718. X                      sizeof(struct utmp)))+wtabsz;
  1719. X              }
  1720. X      fclose(in);
  1721. ***************
  1722. *** 314,320 ****
  1723. X          return;
  1724. X          }
  1725. X      uptr = utab = (struct utmp *) zalloc(utabmax*sizeof(struct utmp));
  1726. !     in = fopen(UTMP_FILE,"r");
  1727. X      while (fread(uptr,sizeof *uptr,1,in))
  1728. X  #ifdef USER_PROCESS
  1729. X          if (uptr->ut_type == USER_PROCESS)
  1730. --- 313,323 ----
  1731. X          return;
  1732. X          }
  1733. X      uptr = utab = (struct utmp *) zalloc(utabmax*sizeof(struct utmp));
  1734. !     if (!(in = fopen(UTMP_FILE,"r")))
  1735. !         {
  1736. !         free(utab);
  1737. !         return;
  1738. !         }
  1739. X      while (fread(uptr,sizeof *uptr,1,in))
  1740. X  #ifdef USER_PROCESS
  1741. X          if (uptr->ut_type == USER_PROCESS)
  1742. ***************
  1743. *** 324,330 ****
  1744. X              {
  1745. X              uptr++;
  1746. X              if (++utabsz == utabmax)
  1747. !                 uptr = (utab = (struct utmp *) realloc((void *) utab,(utabmax*=2)*
  1748. X                      sizeof(struct utmp)))+utabsz;
  1749. X              }
  1750. X      fclose(in);
  1751. --- 327,333 ----
  1752. X              {
  1753. X              uptr++;
  1754. X              if (++utabsz == utabmax)
  1755. !                 uptr = (utab = (struct utmp *) realloc((vptr) utab,(utabmax*=2)*
  1756. X                      sizeof(struct utmp)))+utabsz;
  1757. X              }
  1758. X      fclose(in);
  1759. *** src/zsh0/zsh2.00/src/zle.h    Mon Apr 22 20:37:46 1991
  1760. --- zsh2.00/src/zle.h    Wed May  8 22:34:07 1991
  1761. ***************
  1762. *** 73,78 ****
  1763. --- 73,81 ----
  1764. X  
  1765. X  #endif
  1766. X  
  1767. + /* last named command done */
  1768. + ZLEXTERN int lastnamed;
  1769. X  /* != 0 if we're done */
  1770. X  ZLEXTERN int done;
  1771. X  
  1772. ***************
  1773. *** 175,299 ****
  1774. X  ZLEXTERN char *kring[KRINGCT];
  1775. X  ZLEXTERN int kringnum;
  1776. X  
  1777. ! enum xbindings {
  1778. ! z_acceptandhold,
  1779. ! z_acceptandinfernexthistory,
  1780. ! z_acceptline,
  1781. ! z_acceptlineanddownhistory,
  1782. ! z_backwardchar,
  1783. ! z_backwarddeletechar,
  1784. ! z_backwarddeleteword,
  1785. ! z_backwardkillline,
  1786. ! z_backwardkillword,
  1787. ! z_backwardword,
  1788. ! z_beginningofbufferorhistory,
  1789. ! z_beginningofhistory,
  1790. ! z_beginningofline,
  1791. ! z_capitalizeword,
  1792. ! z_clearscreen,
  1793. ! z_completeword,
  1794. ! z_copyprevword,
  1795. ! z_copyregionaskill,
  1796. ! z_deletechar,
  1797. ! z_deletecharorlist,
  1798. ! z_deleteword,
  1799. ! z_digitargument,
  1800. ! z_downcaseword,
  1801. ! z_downhistory,
  1802. ! z_downlineorhistory,
  1803. ! z_endofbufferorhistory,
  1804. ! z_endofhistory,
  1805. ! z_endofline,
  1806. ! z_exchangepointandmark,
  1807. ! z_expandhistory,
  1808. ! z_expandorcomplete,
  1809. ! z_expandword,
  1810. ! z_forwardchar,
  1811. ! z_forwardword,
  1812. ! z_getline,
  1813. ! z_gosmacstransposechars,
  1814. ! z_historyincrementalsearchbackward,
  1815. ! z_historyincrementalsearchforward,
  1816. ! z_historysearchbackward,
  1817. ! z_historysearchforward,
  1818. ! z_infernexthistory,
  1819. ! z_insertlastword,
  1820. ! z_killbuffer,
  1821. ! z_killline,
  1822. ! z_killregion,
  1823. ! z_killwholeline,
  1824. ! z_listchoices,
  1825. ! z_listexpand,
  1826. ! z_magicspace,
  1827. ! z_menucompleteword,
  1828. ! z_menuexpandorcomplete,
  1829. ! z_metafynext,
  1830. ! z_overwritemode,
  1831. ! z_pushline,
  1832. ! z_quotedinsert,
  1833. ! z_quoteline,
  1834. ! z_quoteregion,
  1835. ! z_redisplay,
  1836. ! z_reversemenucomplete,
  1837. ! z_runhelp,
  1838. ! z_selfinsert,
  1839. ! z_selfinsertunmeta,
  1840. ! z_sendbreak,
  1841. ! z_sendstring,
  1842. ! z_sequenceleadin,
  1843. ! z_setmarkcommand,
  1844. ! z_spellword,
  1845. ! z_toggleliteralhistory,
  1846. ! z_transposechars,
  1847. ! z_transposewords,
  1848. ! z_undefinedkey,
  1849. ! z_undo,
  1850. ! z_universalargument,
  1851. ! z_upcaseword,
  1852. ! z_uphistory,
  1853. ! z_uplineorhistory,
  1854. ! z_viaddeol,
  1855. ! z_viaddnext,
  1856. ! z_vicapslockpanic,
  1857. ! z_vichange,
  1858. ! z_vichangeeol,
  1859. ! z_vichangewholeline,
  1860. ! z_vicmdmode,
  1861. ! z_videlete,
  1862. ! z_vidigitorbeginningofline,
  1863. ! z_vifetchhistory,
  1864. ! z_vifindnextchar,
  1865. ! z_vifindnextcharskip,
  1866. ! z_vifindprevchar,
  1867. ! z_vifindprevcharskip,
  1868. ! z_vifirstnonblank,
  1869. ! z_viforwardwordend,
  1870. ! z_vigotocolumn,
  1871. ! z_vihistorysearchbackward,
  1872. ! z_vihistorysearchforward,
  1873. ! z_viinsert,
  1874. ! z_viinsertbol,
  1875. ! z_vijoin,
  1876. ! z_vimatchbracket,
  1877. ! z_viopenlineabove,
  1878. ! z_viopenlinebelow,
  1879. ! z_vioperswapcases,
  1880. ! z_viputafter,
  1881. ! z_virepeatfind,
  1882. ! z_virepeatsearch,
  1883. ! z_vireplace,
  1884. ! z_vireplacechars,
  1885. ! z_virevrepeatfind,
  1886. ! z_virevrepeatsearch,
  1887. ! z_viswapcase,
  1888. ! z_viundo,
  1889. ! z_viyank,
  1890. ! z_viyankeol,
  1891. ! z_whichcommand,
  1892. ! z_yank,
  1893. ! z_yankpop,
  1894. ! ZLECMDCOUNT
  1895. ! };
  1896. X  
  1897. X  extern struct zlecmd zlecmds[];
  1898. X  
  1899. --- 178,304 ----
  1900. X  ZLEXTERN char *kring[KRINGCT];
  1901. X  ZLEXTERN int kringnum;
  1902. X  
  1903. ! #define z_acceptandhold 0
  1904. ! #define z_acceptandinfernexthistory 1
  1905. ! #define z_acceptandmenucomplete 2
  1906. ! #define z_acceptline 3
  1907. ! #define z_acceptlineanddownhistory 4
  1908. ! #define z_backwardchar 5
  1909. ! #define z_backwarddeletechar 6
  1910. ! #define z_backwarddeleteword 7
  1911. ! #define z_backwardkillline 8
  1912. ! #define z_backwardkillword 9
  1913. ! #define z_backwardword 10
  1914. ! #define z_beginningofbufferorhistory 11
  1915. ! #define z_beginningofhistory 12
  1916. ! #define z_beginningofline 13
  1917. ! #define z_beginningoflinehist 14
  1918. ! #define z_capitalizeword 15
  1919. ! #define z_clearscreen 16
  1920. ! #define z_completeword 17
  1921. ! #define z_copyprevword 18
  1922. ! #define z_copyregionaskill 19
  1923. ! #define z_deletechar 20
  1924. ! #define z_deletecharorlist 21
  1925. ! #define z_deleteword 22
  1926. ! #define z_digitargument 23
  1927. ! #define z_downcaseword 24
  1928. ! #define z_downhistory 25
  1929. ! #define z_downlineorhistory 26
  1930. ! #define z_endofbufferorhistory 27
  1931. ! #define z_endofhistory 28
  1932. ! #define z_endofline 29
  1933. ! #define z_endoflinehist 30
  1934. ! #define z_exchangepointandmark 31
  1935. ! #define z_executelastnamedcmd 32
  1936. ! #define z_executenamedcmd 33
  1937. ! #define z_expandhistory 34
  1938. ! #define z_expandorcomplete 35
  1939. ! #define z_expandword 36
  1940. ! #define z_forwardchar 37
  1941. ! #define z_forwardword 38
  1942. ! #define z_getline 39
  1943. ! #define z_gosmacstransposechars 40
  1944. ! #define z_historyincrementalsearchbackward 41
  1945. ! #define z_historyincrementalsearchforward 42
  1946. ! #define z_historysearchbackward 43
  1947. ! #define z_historysearchforward 44
  1948. ! #define z_infernexthistory 45
  1949. ! #define z_insertlastword 46
  1950. ! #define z_killbuffer 47
  1951. ! #define z_killline 48
  1952. ! #define z_killregion 49
  1953. ! #define z_killwholeline 50
  1954. ! #define z_listchoices 51
  1955. ! #define z_listexpand 52
  1956. ! #define z_magicspace 53
  1957. ! #define z_menucompleteword 54
  1958. ! #define z_menuexpandorcomplete 55
  1959. ! #define z_overwritemode 56
  1960. ! #define z_pushline 57
  1961. ! #define z_quotedinsert 58
  1962. ! #define z_quoteline 59
  1963. ! #define z_quoteregion 60
  1964. ! #define z_redisplay 61
  1965. ! #define z_reversemenucomplete 62
  1966. ! #define z_runhelp 63
  1967. ! #define z_selfinsert 64
  1968. ! #define z_selfinsertunmeta 65
  1969. ! #define z_sendbreak 66
  1970. ! #define z_sendstring 67
  1971. ! #define z_sequenceleadin 68
  1972. ! #define z_setmarkcommand 69
  1973. ! #define z_spellword 70
  1974. ! #define z_toggleliteralhistory 71
  1975. ! #define z_transposechars 72
  1976. ! #define z_transposewords 73
  1977. ! #define z_undefinedkey 74
  1978. ! #define z_undo 75
  1979. ! #define z_universalargument 76
  1980. ! #define z_upcaseword 77
  1981. ! #define z_uphistory 78
  1982. ! #define z_uplineorhistory 79
  1983. ! #define z_viaddeol 80
  1984. ! #define z_viaddnext 81
  1985. ! #define z_vicapslockpanic 82
  1986. ! #define z_vichange 83
  1987. ! #define z_vichangeeol 84
  1988. ! #define z_vichangewholeline 85
  1989. ! #define z_vicmdmode 86
  1990. ! #define z_videlete 87
  1991. ! #define z_vidigitorbeginningofline 88
  1992. ! #define z_vifetchhistory 89
  1993. ! #define z_vifindnextchar 90
  1994. ! #define z_vifindnextcharskip 91
  1995. ! #define z_vifindprevchar 92
  1996. ! #define z_vifindprevcharskip 93
  1997. ! #define z_vifirstnonblank 94
  1998. ! #define z_viforwardwordend 95
  1999. ! #define z_vigotocolumn 96
  2000. ! #define z_vihistorysearchbackward 97
  2001. ! #define z_vihistorysearchforward 98
  2002. ! #define z_viinsert 99
  2003. ! #define z_viinsertbol 100
  2004. ! #define z_vijoin 101
  2005. ! #define z_vimatchbracket 102
  2006. ! #define z_viopenlineabove 103
  2007. ! #define z_viopenlinebelow 104
  2008. ! #define z_vioperswapcases 105
  2009. ! #define z_viputafter 106
  2010. ! #define z_virepeatfind 107
  2011. ! #define z_virepeatsearch 108
  2012. ! #define z_vireplace 109
  2013. ! #define z_vireplacechars 110
  2014. ! #define z_virevrepeatfind 111
  2015. ! #define z_virevrepeatsearch 112
  2016. ! #define z_viswapcase 113
  2017. ! #define z_viundo 114
  2018. ! #define z_viyank 115
  2019. ! #define z_viyankeol 116
  2020. ! #define z_whichcommand 117
  2021. ! #define z_yank 118
  2022. ! #define z_yankpop 119
  2023. ! #define ZLECMDCOUNT 120
  2024. X  
  2025. X  extern struct zlecmd zlecmds[];
  2026. X  
  2027. *** src/zsh0/zsh2.00/src/zle_bindings.c    Tue Apr 23 00:30:05 1991
  2028. --- zsh2.00/src/zle_bindings.c    Fri May 10 14:34:23 1991
  2029. ***************
  2030. *** 32,42 ****
  2031. X  
  2032. X  #define ZLE
  2033. X  #include "zsh.h"
  2034. - #include "funcs.h"
  2035. X  
  2036. X  struct zlecmd zlecmds[] = {
  2037. X  "accept-and-hold",acceptandhold,0,
  2038. X  "accept-and-infer-next-history",acceptandinfernexthistory,0,
  2039. X  "accept-line",acceptline,0,
  2040. X  "accept-line-and-down-history",acceptlineanddownhistory,ZLE_MOD,
  2041. X  "backward-char",backwardchar,ZLE_MOVE,
  2042. --- 32,43 ----
  2043. X  
  2044. X  #define ZLE
  2045. X  #include "zsh.h"
  2046. X  
  2047. X  struct zlecmd zlecmds[] = {
  2048. X  "accept-and-hold",acceptandhold,0,
  2049. X  "accept-and-infer-next-history",acceptandinfernexthistory,0,
  2050. + "accept-and-menu-complete", acceptandmenucomplete, ZLE_MOD|ZLE_MENUCMP,
  2051. X  "accept-line",acceptline,0,
  2052. X  "accept-line-and-down-history",acceptlineanddownhistory,ZLE_MOD,
  2053. X  "backward-char",backwardchar,ZLE_MOVE,
  2054. ***************
  2055. *** 48,53 ****
  2056. --- 49,55 ----
  2057. X  "beginning-of-buffer-or-history",beginningofbufferorhistory,ZLE_LINEMOVE,
  2058. X  "beginning-of-history",beginningofhistory,ZLE_MOD,
  2059. X  "beginning-of-line",beginningofline,ZLE_MOVE,
  2060. + "beginning-of-line-hist",beginningoflinehist,ZLE_LINEMOVE,
  2061. X  "capitalize-word",capitalizeword,ZLE_MOD,
  2062. X  "clear-screen",clearscreen,0,
  2063. X  "complete-word",completeword,ZLE_MOD|ZLE_MENUCMP,
  2064. ***************
  2065. *** 54,60 ****
  2066. X  "copy-prev-word",copyprevword,ZLE_MOD,
  2067. X  "copy-region-as-kill",copyregionaskill,ZLE_KILL,
  2068. X  "delete-char",deletechar,ZLE_INSMOD,
  2069. ! "delete-char-or-list",deletecharorlist,ZLE_INSMOD,
  2070. X  "delete-word",deleteword,ZLE_MOD,
  2071. X  "digit-argument",digitargument,ZLE_ARG,
  2072. X  "down-case-word",downcaseword,ZLE_MOD,
  2073. --- 56,62 ----
  2074. X  "copy-prev-word",copyprevword,ZLE_MOD,
  2075. X  "copy-region-as-kill",copyregionaskill,ZLE_KILL,
  2076. X  "delete-char",deletechar,ZLE_INSMOD,
  2077. ! "delete-char-or-list",deletecharorlist,ZLE_INSMOD|ZLE_MENUCMP,
  2078. X  "delete-word",deleteword,ZLE_MOD,
  2079. X  "digit-argument",digitargument,ZLE_ARG,
  2080. X  "down-case-word",downcaseword,ZLE_MOD,
  2081. ***************
  2082. *** 63,69 ****
  2083. --- 65,74 ----
  2084. X  "end-of-buffer-or-history",endofbufferorhistory,ZLE_LINEMOVE,
  2085. X  "end-of-history",endofhistory,ZLE_MOD,
  2086. X  "end-of-line",endofline,ZLE_MOVE,
  2087. + "end-of-line-hist",endoflinehist,ZLE_LINEMOVE,
  2088. X  "exchange-point-and-mark",exchangepointandmark,ZLE_MOVE,
  2089. + "execute-last-named-cmd",NULL,0,
  2090. + "execute-named-cmd",NULL,0,
  2091. X  "expand-history",expandhistory,ZLE_MOD,
  2092. X  "expand-or-complete",expandorcomplete,ZLE_MOD|ZLE_MENUCMP,
  2093. X  "expand-word",expandword,ZLE_MOD,
  2094. ***************
  2095. *** 82,92 ****
  2096. X  "kill-region",killregion,ZLE_MOD|ZLE_KILL,
  2097. X  "kill-whole-line",killwholeline,ZLE_MOD|ZLE_KILL,
  2098. X  "list-choices",listchoices,0,
  2099. ! "list-expand",listexpand,0,
  2100. X  "magic-space",magicspace,ZLE_MOD,
  2101. ! "menu-complete-word",menucompleteword,ZLE_MOD|ZLE_MENUCMP,
  2102. X  "menu-expand-or-complete",menuexpandorcomplete,ZLE_MOD|ZLE_MENUCMP,
  2103. - "metafy-next",metafynext,0,
  2104. X  "overwrite-mode",overwritemode,0,
  2105. X  "push-line",pushline,ZLE_MOD,
  2106. X  "quoted-insert",quotedinsert,ZLE_INSMOD,
  2107. --- 87,96 ----
  2108. X  "kill-region",killregion,ZLE_MOD|ZLE_KILL,
  2109. X  "kill-whole-line",killwholeline,ZLE_MOD|ZLE_KILL,
  2110. X  "list-choices",listchoices,0,
  2111. ! "list-expand",listexpand,ZLE_MENUCMP,
  2112. X  "magic-space",magicspace,ZLE_MOD,
  2113. ! "menu-complete",menucompleteword,ZLE_MOD|ZLE_MENUCMP,
  2114. X  "menu-expand-or-complete",menuexpandorcomplete,ZLE_MOD|ZLE_MENUCMP,
  2115. X  "overwrite-mode",overwritemode,0,
  2116. X  "push-line",pushline,ZLE_MOD,
  2117. X  "quoted-insert",quotedinsert,ZLE_INSMOD,
  2118. ***************
  2119. *** 182,188 ****
  2120. X  /* ^X */ z_sequenceleadin,
  2121. X  /* ^Y */ z_yank,
  2122. X  /* ^Z */ z_undefinedkey,
  2123. ! /* ^[ */ z_metafynext,
  2124. X  /* ^\ */ z_undefinedkey,
  2125. X  /* ^] */ z_undefinedkey,
  2126. X  /* ^^ */ z_undefinedkey,
  2127. --- 186,192 ----
  2128. X  /* ^X */ z_sequenceleadin,
  2129. X  /* ^Y */ z_yank,
  2130. X  /* ^Z */ z_undefinedkey,
  2131. ! /* ^[ */ z_sequenceleadin,
  2132. X  /* ^\ */ z_undefinedkey,
  2133. X  /* ^] */ z_undefinedkey,
  2134. X  /* ^^ */ z_undefinedkey,
  2135. ***************
  2136. *** 329,336 ****
  2137. X  /* M-+ */ z_undefinedkey,
  2138. X  /* M-, */ z_undefinedkey,
  2139. X  /* M-- */ z_undefinedkey,
  2140. ! /* M-. */ z_undefinedkey,
  2141. ! /* M-/ z_*/ z_undefinedkey,
  2142. X  /* M-0 */ z_digitargument,
  2143. X  /* M-1 */ z_digitargument,
  2144. X  /* M-2 */ z_digitargument,
  2145. --- 333,340 ----
  2146. X  /* M-+ */ z_undefinedkey,
  2147. X  /* M-, */ z_undefinedkey,
  2148. X  /* M-- */ z_undefinedkey,
  2149. ! /* M-. */ z_insertlastword,
  2150. ! /* M-/ */ z_undefinedkey,
  2151. X  /* M-0 */ z_digitargument,
  2152. X  /* M-1 */ z_digitargument,
  2153. X  /* M-2 */ z_digitargument,
  2154. ***************
  2155. *** 403,411 ****
  2156. X  /* M-u */ z_upcaseword,
  2157. X  /* M-v */ z_undefinedkey,
  2158. X  /* M-w */ z_copyregionaskill,
  2159. ! /* M-x */ z_undefinedkey,
  2160. X  /* M-y */ z_yankpop,
  2161. ! /* M-z */ z_undefinedkey,
  2162. X  /* M-{ */ z_undefinedkey,
  2163. X  /* M-| */ z_vigotocolumn,
  2164. X  /* M-} */ z_undefinedkey,
  2165. --- 407,415 ----
  2166. X  /* M-u */ z_upcaseword,
  2167. X  /* M-v */ z_undefinedkey,
  2168. X  /* M-w */ z_copyregionaskill,
  2169. ! /* M-x */ z_executenamedcmd,
  2170. X  /* M-y */ z_yankpop,
  2171. ! /* M-z */ z_executelastnamedcmd,
  2172. X  /* M-{ */ z_undefinedkey,
  2173. X  /* M-| */ z_vigotocolumn,
  2174. X  /* M-} */ z_undefinedkey,
  2175. ***************
  2176. *** 476,482 ****
  2177. X  /* ^X */ z_expandorcomplete,
  2178. X  /* ^Y */ z_undefinedkey,
  2179. X  /* ^Z */ z_undefinedkey,
  2180. ! /* ^[ */ z_metafynext,
  2181. X  /* ^\ */ z_undefinedkey,
  2182. X  /* ^] */ z_undefinedkey,
  2183. X  /* ^^ */ z_undefinedkey,
  2184. SHAR_EOF
  2185. true || echo 'restore of patches failed'
  2186. echo 'End of  part 3'
  2187. echo 'File patches is continued in part 4'
  2188. echo 4 > _shar_seq_.tmp
  2189. exit 0
  2190.               Paul Falstad  pfalstad@phoenix.princeton.edu
  2191.          And on the roads, too, vicious gangs of KEEP LEFT signs!
  2192.      If Princeton knew my opinions, they'd have expelled me long ago.
  2193.  
  2194. exit 0 # Just in case...
  2195. -- 
  2196. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  2197. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  2198. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  2199. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  2200.