bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

groff, pic and -U


From: Jennifer Sayers
Subject: groff, pic and -U
Date: Thu, 31 Aug 2006 14:06:38 +1000
User-agent: Mutt/1.3.25i

Dear Groff Maintainer,

I wish to report a problem in the interface between groff and pic.

groff -p -U does not pass the -U flag on to pic.  As pic has a default
of -S, it is impossible to run pic in unsafe mode from the groff
front end.

******************************************************************************
DEMONSTRATION OF PROBLEM:
******************************************************************************

-bash-3.00$ groff -v
GNU groff version 1.19.3
Copyright (C) 2005 Free Software Foundation, Inc.
GNU groff comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of groff and its subprograms
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

called subprograms:

GNU grops (groff) version 1.19.3
GNU troff (groff) version 1.19.3
$ cat sh.pic
.PS
sh "echo hello"
.PE
$ groff -p sh.pic > ps
pic:sh.pic:2: unsafe to run command `echo hello'
$ groff -p -U sh.pic > ps
pic:sh.pic:2: unsafe to run command `echo hello'
$ # I now install the version with my patch
$ groff -p sh.pic > ps
pic:sh.pic:2: unsafe to run command `echo hello'
$ groff -p -U sh.pic > ps
$ grep hello ps
/F0 10/address@hidden SF(hello)72 12 Q 0 Cg EP
$

******************************************************************************
PATCH:
******************************************************************************

I offer a patch to fix this in version "GNU groff version 1.19.3":

file groff.cpp:

CHANGE:

  if (safer_flag)
    commands[PIC_INDEX].append_arg("-S");
  else
    commands[TROFF_INDEX].insert_arg("-U");

TO:

  if (safer_flag)
    commands[PIC_INDEX].append_arg("-S");
  else {
    commands[PIC_INDEX].append_arg("-U");
    commands[TROFF_INDEX].insert_arg("-U");
  }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]