Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!munnari!gwydir!gara!wtoomey From: wtoomey@gara.une.oz (Warren Toomey) Newsgroups: comp.os.minix Subject: Official Clam Patch #2 (Part 4 of 4) Message-ID: <782@gara.une.oz> Date: 1 Jun 89 10:36:07 GMT Organization: University of New England, Armidale, Australia Lines: 537 # This is a shell archive. Remove anything before this line, then # unpack it by saving it in a file and typing "sh file". (Files # unpacked will be owned by you and have default permissions.) # # This archive contains: # job.cdif main.cdif meta.cdif echo x - job.cdif cat > "job.cdif" << '//E*O*F job.cdif//' *** ../Patch1/job.c Thu Jun 1 17:03:46 1989 --- job.c Thu Jun 1 16:55:54 1989 *************** *** 399,405 printf("\n%s\n",siglist[status.w_stopsig]); } else ! printf("\n%s\n",siglist[status.w_termsig]); fflush(stdout); } c=vget("cwd"); --- 399,408 ----- printf("\n%s\n",siglist[status.w_stopsig]); } else ! if (status.w_coredump) ! printf("\n%s (core dumped)\n",siglist[status.w_termsig]); ! else ! printf("\n%s\n",siglist[status.w_termsig]); fflush(stdout); } c=vget("cwd"); //E*O*F job.cdif// echo x - main.cdif cat > "main.cdif" << '//E*O*F main.cdif//' *** ../Patch1/main.c Thu Jun 1 17:04:26 1989 --- main.c Thu Jun 1 16:56:32 1989 *************** *** 277,282 termod->sg_flags &= (~ECHO); /* do not echo chars to screen */ if (ioctl(0,TIOCSETP,termod)) /* put it back, modified */ perror("ioctl"); setsigc=(struct tchars *) malloc ((unsigned)(sizeof(struct tchars))); if (ioctl(0,TIOCGETC,setsigc)) /* get the tchars struct */ perror("ioctl"); --- 277,283 ----- termod->sg_flags &= (~ECHO); /* do not echo chars to screen */ if (ioctl(0,TIOCSETP,termod)) /* put it back, modified */ perror("ioctl"); + free(termod); setsigc=(struct tchars *) malloc ((unsigned)(sizeof(struct tchars))); if (ioctl(0,TIOCGETC,setsigc)) /* get the tchars struct */ perror("ioctl"); *************** *** 281,287 if (ioctl(0,TIOCGETC,setsigc)) /* get the tchars struct */ perror("ioctl"); setsigc->t_intrc=(UNDEF); /* no interrupt or quitting */ ! /*setsigc->t_quitc=(UNDEF); allow quit while debugging */ setsigc->t_eofc=(UNDEF); /* or eof signalling */ if (ioctl(0,TIOCSETC,setsigc)) /* put it back, modified */ perror("ioctl"); --- 282,288 ----- if (ioctl(0,TIOCGETC,setsigc)) /* get the tchars struct */ perror("ioctl"); setsigc->t_intrc=(UNDEF); /* no interrupt or quitting */ ! /*setsigc->t_quitc=(UNDEF); Allow quit while debugging */ setsigc->t_eofc=(UNDEF); /* or eof signalling */ if (ioctl(0,TIOCSETC,setsigc)) /* put it back, modified */ perror("ioctl"); *************** *** 285,290 setsigc->t_eofc=(UNDEF); /* or eof signalling */ if (ioctl(0,TIOCSETC,setsigc)) /* put it back, modified */ perror("ioctl"); # ifndef MINIX moresigc.t_suspc=(UNDEF); /* no stopping */ moresigc.t_dsuspc=(UNDEF); /* or delayed stopping */ --- 286,292 ----- setsigc->t_eofc=(UNDEF); /* or eof signalling */ if (ioctl(0,TIOCSETC,setsigc)) /* put it back, modified */ perror("ioctl"); + free(setsigc); # ifndef MINIX moresigc.t_suspc=(UNDEF); /* no stopping */ moresigc.t_dsuspc=(UNDEF); /* or delayed stopping */ *************** *** 292,298 moresigc.t_flushc=(UNDEF); /* or flushing */ moresigc.t_werasc=(UNDEF); /* or word erasing */ moresigc.t_lnextc=(UNDEF); /* or literal quoting */ ! if (ioctl(0,TIOCSLTC,&moresigc)) /* set ltchars struct to be all undef */ perror("ioctl"); # endif #endif --- 294,300 ----- moresigc.t_flushc=(UNDEF); /* or flushing */ moresigc.t_werasc=(UNDEF); /* or word erasing */ moresigc.t_lnextc=(UNDEF); /* or literal quoting */ ! if (ioctl(0,TIOCSLTC,&moresigc)) /* set ltchars struct to be all undef */ perror("ioctl"); # endif #endif *************** *** 344,349 struct tchars *setsigc; # ifndef MINIX struct ltchars moresigc; # endif #ifdef DEBUG --- 346,352 ----- struct tchars *setsigc; # ifndef MINIX struct ltchars moresigc; + int pid; # endif #ifdef DEBUG *************** *** 357,362 termod->sg_flags &= (~ECHO); /* do not echo chars to screen */ if (ioctl(0,TIOCSETN,termod)) /* put it back, modified */ perror("ioctl"); setsigc=(struct tchars *) malloc ((unsigned)(sizeof(struct tchars))); if (ioctl(0,TIOCGETC,setsigc)) /* get the tchars struct */ perror("ioctl"); --- 360,366 ----- termod->sg_flags &= (~ECHO); /* do not echo chars to screen */ if (ioctl(0,TIOCSETN,termod)) /* put it back, modified */ perror("ioctl"); + free(termod); setsigc=(struct tchars *) malloc ((unsigned)(sizeof(struct tchars))); if (ioctl(0,TIOCGETC,setsigc)) /* get the tchars struct */ perror("ioctl"); *************** *** 365,370 setsigc->t_eofc=(UNDEF); /* or eof signalling */ if (ioctl(0,TIOCSETC,setsigc)) /* put it back, modified */ perror("ioctl"); # ifndef MINIX moresigc.t_suspc=(UNDEF); /* no stopping */ moresigc.t_dsuspc=(UNDEF); /* or delayed stopping */ --- 369,375 ----- setsigc->t_eofc=(UNDEF); /* or eof signalling */ if (ioctl(0,TIOCSETC,setsigc)) /* put it back, modified */ perror("ioctl"); + free(setsigc); # ifndef MINIX moresigc.t_suspc=(UNDEF); /* no stopping */ moresigc.t_dsuspc=(UNDEF); /* or delayed stopping */ *************** *** 374,379 moresigc.t_lnextc=(UNDEF); /* or literal quoting */ if (ioctl(0,TIOCSLTC,&moresigc)) /* set ltchars struct to be all undef */ perror("ioctl"); # endif #endif --- 379,386 ----- moresigc.t_lnextc=(UNDEF); /* or literal quoting */ if (ioctl(0,TIOCSLTC,&moresigc)) /* set ltchars struct to be all undef */ perror("ioctl"); + pid=getpid(); + if (ioctl(0,TIOCSPGRP,&pid)) perror("ioctl stpg"); # endif #endif *************** *** 451,457 else { /* either logout or exit according to invokename*/ if (loginsh==TRUE) logout(numargs,arguments); /* truncated args */ ! else write(1,"Exit\n",5); setdown(); exit(0); } --- 458,464 ----- else { /* either logout or exit according to invokename*/ if (loginsh==TRUE) logout(numargs,arguments); /* truncated args */ ! else write(1,"exit\n",5); setdown(); exit(0); } *************** *** 565,574 while (act!=ENDLN && act!=ERRER) { retval=0; ! #if 0 ! /* Was this: appears to be totally wrong */ ! act=intercom(line,&pos,&pid,FALSE,NULL,1); ! #else act=intercom(line,&pos,&pid,&i ,FALSE,1); /* call intercom with fromfile set -- ?? the big question is do we */ /* really ignore the value of outpfd - i dunno., could'nt make out, */ --- 572,581 ----- while (act!=ENDLN && act!=ERRER) { retval=0; ! ! /* Was this: appears to be totally wrong ! act=intercom(line,&pos,&pid,FALSE,NULL,1); */ ! act=intercom(line,&pos,&pid,&i ,FALSE,1); /* call intercom with fromfile set -- ?? the big question is do we */ /* really ignore the value of outpfd - I dunno., couldn't make out, */ *************** *** 571,578 #else act=intercom(line,&pos,&pid,&i ,FALSE,1); /* call intercom with fromfile set -- ?? the big question is do we */ ! /* really ignore the value of outpfd - i dunno., could'nt make out, */ ! /* so i just put in &i, otherwise obviusly this call causes bombs in */ /* intercom() */ #endif #if 0 --- 578,585 ----- act=intercom(line,&pos,&pid,&i ,FALSE,1); /* call intercom with fromfile set -- ?? the big question is do we */ ! /* really ignore the value of outpfd - I dunno., couldn't make out, */ ! /* so I just put in &i, otherwise obviously this call causes bombs in */ /* intercom() */ for (i=3;i<=NFILES;i++) if (i!=fileno(finp)) close(i); if (pid && act!=BCKGND) *************** *** 574,583 /* really ignore the value of outpfd - i dunno., could'nt make out, */ /* so i just put in &i, otherwise obviusly this call causes bombs in */ /* intercom() */ - #endif - #if 0 - for (i=3;i<=20;i++) if (i!=fileno(finp)) close(i); - #else for (i=3;i<=NFILES;i++) if (i!=fileno(finp)) close(i); #endif if (pid && act!=BCKGND) --- 581,586 ----- /* really ignore the value of outpfd - I dunno., couldn't make out, */ /* so I just put in &i, otherwise obviously this call causes bombs in */ /* intercom() */ for (i=3;i<=NFILES;i++) if (i!=fileno(finp)) close(i); if (pid && act!=BCKGND) retval=waitfor(pid); *************** *** 579,585 for (i=3;i<=20;i++) if (i!=fileno(finp)) close(i); #else for (i=3;i<=NFILES;i++) if (i!=fileno(finp)) close(i); - #endif if (pid && act!=BCKGND) retval=waitfor(pid); if (!disable_auto && act==ERRER) exit(1); /* exit on shell syntax error */ --- 582,587 ----- /* so I just put in &i, otherwise obviously this call causes bombs in */ /* intercom() */ for (i=3;i<=NFILES;i++) if (i!=fileno(finp)) close(i); if (pid && act!=BCKGND) retval=waitfor(pid); if (!disable_auto && act==ERRER) exit(1); /* exit on shell syntax error */ *************** *** 753,762 while (act!=ENDLN && act!=ERRER) { retval=0; ! #if 0 ! /* WAS: same intercom problem as in file() here */ ! act=intercom(line,&pos,&pid,FALSE,NULL,0); ! #else act=intercom(line,&pos,&pid, &i, FALSE,0); /* call intercom with fromfile not set */ #endif #if 0 --- 755,764 ----- while (act!=ENDLN && act!=ERRER) { retval=0; ! ! /* WAS: same intercom problem as in file() here ! act=intercom(line,&pos,&pid,FALSE,NULL,0); */ ! act=intercom(line,&pos,&pid, &i, FALSE,0); /* call intercom with fromfile not set */ for (i=3;i<=NFILES;i++) close(i); *************** *** 758,767 act=intercom(line,&pos,&pid,FALSE,NULL,0); #else act=intercom(line,&pos,&pid, &i, FALSE,0); /* call intercom with fromfile not set */ ! #endif ! #if 0 ! for (i=3;i<=20;i++) close(i); ! #else for (i=3;i<=NFILES;i++) close(i); #endif if (pid && act!=BCKGND) --- 760,766 ----- act=intercom(line,&pos,&pid,FALSE,NULL,0); */ act=intercom(line,&pos,&pid, &i, FALSE,0); /* call intercom with fromfile not set */ ! for (i=3;i<=NFILES;i++) close(i); if (pid && act!=BCKGND) retval=waitfor(pid); *************** *** 763,769 for (i=3;i<=20;i++) close(i); #else for (i=3;i<=NFILES;i++) close(i); - #endif if (pid && act!=BCKGND) retval=waitfor(pid); #ifndef MINIX --- 762,767 ----- act=intercom(line,&pos,&pid, &i, FALSE,0); /* call intercom with fromfile not set */ for (i=3;i<=NFILES;i++) close(i); if (pid && act!=BCKGND) retval=waitfor(pid); #ifndef MINIX *************** *** 819,828 while (act!=ENDLN && act!=ERRER) { retval=0; - #if 0 - /* WAS: sample problem */ - act=intercom(line,&pos,&pid,FALSE,NULL,0); /* call intercom with fromfile not set */ - #else act=intercom(line,&pos,&pid, &i,FALSE,0); /* call intercom with fromfile not set */ #endif #if 0 --- 817,822 ----- while (act!=ENDLN && act!=ERRER) { retval=0; act=intercom(line,&pos,&pid, &i,FALSE,0); /* call intercom with fromfile not set */ for (i=3;i<=NFILES;i++) close(i); if (pid && act!=BCKGND) *************** *** 824,833 act=intercom(line,&pos,&pid,FALSE,NULL,0); /* call intercom with fromfile not set */ #else act=intercom(line,&pos,&pid, &i,FALSE,0); /* call intercom with fromfile not set */ - #endif - #if 0 - for (i=3;i<=20;i++) close(i); - #else for (i=3;i<=NFILES;i++) close(i); #endif if (pid && act!=BCKGND) --- 818,823 ----- { retval=0; act=intercom(line,&pos,&pid, &i,FALSE,0); /* call intercom with fromfile not set */ for (i=3;i<=NFILES;i++) close(i); if (pid && act!=BCKGND) retval=waitfor(pid); *************** *** 829,835 for (i=3;i<=20;i++) close(i); #else for (i=3;i<=NFILES;i++) close(i); - #endif if (pid && act!=BCKGND) retval=waitfor(pid); #ifndef MINIX --- 819,824 ----- retval=0; act=intercom(line,&pos,&pid, &i,FALSE,0); /* call intercom with fromfile not set */ for (i=3;i<=NFILES;i++) close(i); if (pid && act!=BCKGND) retval=waitfor(pid); #ifndef MINIX //E*O*F main.cdif// echo x - meta.cdif cat > "meta.cdif" << '//E*O*F meta.cdif//' *** ../Patch1/meta.c Thu Jun 1 17:05:18 1989 --- meta.c Thu Jun 1 16:57:22 1989 *************** *** 172,178 i=0; while (!feof(progout)) { ! c = getc(progout); #ifdef DEBUG fprintf(stderr,"%o",c); #endif --- 172,178 ----- i=0; while (!feof(progout)) { ! if ((c = getc(progout))==EOF) break; #ifdef DEBUG fprintf(stderr,"%o",c); #endif *************** *** 406,412 char *line,*word; int *pos; { ! int l=1,insym=0,inword=0,i=0; word[0]=EOS; while(l) --- 406,412 ----- char *line,*word; int *pos; { ! int l=1,insym=0,inword=0,i=0,quote=0; word[0]=EOS; while(l) *************** *** 437,442 } else (*pos)++; break; default: if (insym) { --- 437,445 ----- } else (*pos)++; break; + case '"': + while((word[i++]=line[(*pos)++])!='"'); + break; default: if (insym) { *************** *** 689,694 j=0; while ((err=loadpattern(line,&i,word,&pattern))==FINE) { if (pattern==FALSE) /* if no * ? [] then add to line */ { if (j!=0) newline[j++]=' '; --- 692,700 ----- j=0; while ((err=loadpattern(line,&i,word,&pattern))==FINE) { + #ifdef DEBUG + fprintf(stderr,"word was %s<\n",word); + #endif if (pattern==FALSE) /* if no * ? [] then add to line */ { if (j!=0) newline[j++]=' '; *************** *** 697,702 newline[j]=EOS; continue; } /* if an absolute path name is given, then chop it off the front of word and put it in dir. Now word contains the patterned stuff onwards. */ finddir(word,dir); --- 703,711 ----- newline[j]=EOS; continue; } + #ifdef DEBUG + fprintf(stderr,"newline in pattern_match\n%s\n",newline); + #endif /* if an absolute path name is given, then chop it off the front of word and put it in dir. Now word contains the patterned stuff onwards. */ finddir(word,dir); *************** *** 1145,1150 if (m_err=curly(line)) return(m_err); if (Tilde==TRUE) if (m_err=tilde(line)) return(m_err); if (Pattern==TRUE) if (m_err=pattern_match(line)) return(m_err); if (Bquote==TRUE) --- 1154,1162 ----- if (m_err=curly(line)) return(m_err); if (Tilde==TRUE) if (m_err=tilde(line)) return(m_err); + #ifdef DEBUG + fprintf(stderr,"line before pattern_match\n%s\n",line); + #endif if (Pattern==TRUE) if (m_err=pattern_match(line)) return(m_err); #ifdef DEBUG *************** *** 1147,1152 if (m_err=tilde(line)) return(m_err); if (Pattern==TRUE) if (m_err=pattern_match(line)) return(m_err); if (Bquote==TRUE) if (m_err=backquote(line)) return(m_err); --- 1159,1167 ----- #endif if (Pattern==TRUE) if (m_err=pattern_match(line)) return(m_err); + #ifdef DEBUG + fprintf(stderr,"line after pattern_match\n%s\n",line); + #endif if (Bquote==TRUE) if (m_err=backquote(line)) return(m_err); //E*O*F meta.cdif// exit 0