[GRASS-dev] gis.m patch
Glynn Clements
glynn at gclements.plus.com
Sat Sep 2 13:56:00 EDT 2006
Huidae Cho wrote:
> I've patched gis.m so that it can run on Windows natively with the help
> of direct rendering. PDCurses lets the user to start in text mode, but
> since there are no monitors available, gis.m is the only option for now.
> + if { $mingw == "1" } {
> + set failure [catch {exec [list "|g.findfile" "element=$elem" "file=$name"] >& nul}]
> + } {
> + set failure [catch {exec [list "|g.findfile" "element=$elem" "file=$name"] >& /dev/null}]
> + }
Rather than duplicate entire commands, I would be inclined to create a
global variable, e.g.:
set devnull [expr {$mingw == 1 ? "nul" : "/dev/null"}]
then use:
global devnull
...
set failure [catch {exec "|g.findfile" "element=$elem" "file=$name" >& $devnull}]
[Note that the original exec command was broken.]
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list