Thanks for reporting this.  Try this patch and let me know if it fixes it
for you:

--- old/bltins/print.c Thu May 29 07:49:59 2014
+++ new/bltins/print.c Sun Aug  3 14:51:07 2014
@@ -193,7 +193,8 @@
  /* print to history file */
  if(!sh_histinit((void*)shp))
  errormsg(SH_DICT,ERROR_system(1),e_history);
- fd = sffileno(shp->gd->hist_ptr->histfp);
+ outfile = shp->gd->hist_ptr->histfp;
+ fd = sffileno(outfile);
  sh_onstate(shp,SH_HISTORY);
  sflag++;
  break;
@@ -288,6 +289,8 @@
  errno = EBADF;
  n = 0;
  }
+ else if(sflag)
+ n = IOREAD|IOWRITE|IOSEEK;
  else if(!(n=shp->fdstatus[fd]))
  n = sh_iocheckfd(shp,fd,fd);
  if(!(n&IOWRITE))
@@ -297,7 +300,7 @@
  return(1);
  errormsg(SH_DICT,ERROR_system(1),msg);
  }
- if(!(outfile=shp->sftable[fd]))
+ if(!sflag && !(outfile=shp->sftable[fd]))
  {
  sh_onstate(shp,SH_NOTRACK);
  n = SF_WRITE|((n&IOREAD)?SF_READ:0);




On Fri, Aug 1, 2014 at 2:45 AM, Dr. Werner Fink <[email protected]> wrote:

> Hi,
>
> I've a report that print -s don't work anymore with version v-
>
>  # print -s test
>  /bin/ksh: print: bad file unit number
>
> Indeed I can verify this:
>
>  BUILD/ksh93> print -s test
>  ./arch/linux.i386-64/src/cmd/ksh93/ksh: print: bad file unit number
>
> Werner
>
> --
>   "Having a smoking section in a restaurant is like having
>           a peeing section in a swimming pool." -- Edward Burr
>
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to