From 2351081f90923e4a56176caf8b35256ac5328658 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Mon, 20 Feb 2012 10:43:42 +0000 Subject: [PATCH] dot/mykermrc.in: More awful hacking to set directories. I don't understand how Kermit's space-splitting rules apply to variables yet, but passing a variable reference to SET MUMBLE DIRECTORY doesn't work, and stuffing the whole lot into a macro and then running it does, so do that despite its awfulness. --- dot/mykermrc.in | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/dot/mykermrc.in b/dot/mykermrc.in index 9baf517..b02503a 100644 --- a/dot/mykermrc.in +++ b/dot/mykermrc.in @@ -23,31 +23,28 @@ set dial ld-prefix 0 set dial intl-prefix 00 ;; Directories. -def _dir_exist { - undef _dir - for \%i 1 \fdim(&v) 1 { - if exist \&v[\%i] { - if def _dir assign _dir \m(_dir) \&v[\%i] - else assign _dir \&v[\%i] +def _set_dir { + local what list awful + assign what \%1 + undef list + shift + + for \%i 1 \v(argc)-1 1 { + if exist \%1 { + if def list assign list \m(list) \%1 + else assign list \%1 } + shift } + assign awful { set \m(what) directory \m(list) } + do awful } - -local \&v -local \%n -array dcl v = - +_set_dir network - \m(_profile)kermit/net.shared - \m(_dot)net.local -local _dir -_dir_exist -set network directory \m(_dir) - -array dcl v = - +_set_dir dial - \m(_profile)kermit/dial.shared - \m(_dot)dial.local -local _dir -_dir_exist -set dial directory \m(_dir) ;; If my terminal is UTF8 then try to use that consistently. This may not ;; work, but in my world as it is it's quite likely to. -- 2.11.0