On Mon, Aug 18, 2014 at 09:34:56PM -0400, David Korn wrote:
> Try this patch.  It should ignore that cat is a built-in of /bin/cat and
> runs /bin/cat instead when it is the last command of ``.  Let me know if
> this fixes the problem.
> 
> --- old/sh/xec.c        Mon Aug 18 17:53:43 2014
> +++ new/sh/xec.c        Mon Aug 18 18:23:58 2014
> @@ -1253,9 +1253,14 @@
>                                 }
>                                 if(np && pipejob==2)
>                                 {
> -                                       job_unlock();
> -                                       nlock--;
> -                                       pipejob = 1;
> +                                       if(shp->comsub==1 && np &&
> is_abuiltin(np) && *np->nvname=='/')
> +                                               np = 0;
> +                                       else
> +                                       {
> +                                               job_unlock();
> +                                               nlock--;
> +                                               pipejob = 1;
> +                                       }
>                                 }
>                                 /* check for builtins */
>                                 if(np && is_abuiltin(np))

This change works for the cat builtin but the test suite now shows:

[  907s] test subshell begins at 2014-08-19+12:40:15
[  922s]        subshell.sh[682]: non-existant last command in pipeline causes 
`` to fail
[  922s] test subshell failed at 2014-08-19+12:40:30 with exit code 1 [ 70 
tests 1 error ]
[  922s] test subshell(C.UTF-8) begins at 2014-08-19+12:40:30
[  936s]        subshell.sh[682]: non-existant last command in pipeline causes 
`` to fail
[  936s] test subshell(C.UTF-8) failed at 2014-08-19+12:40:44 with exit code 1 
[ 70 tests 1 error ]
[  936s] test subshell(shcomp) begins at 2014-08-19+12:40:44
[  951s]        shcomp-subshell.ksh[682]: non-existant last command in pipeline 
causes `` to fail
[  951s] test subshell(shcomp) failed at 2014-08-19+12:40:59 with exit code 1 [ 
70 tests 1 error ]


-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr

Attachment: pgp7iYBNOouEE.pgp
Description: PGP signature

_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to