Current-Users archive

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

Re: x86 console size



On Wed, Jun 08, 2022 at 21:35:49 +0000, RVP wrote:

> Apropos that: can this patch be applied so that font-names (and their
> filenames) can be quoted more intuitively?
> Like this:
> 
> setvar ttyE0   font            Boldface\ 16x32
> 
> instead of (currently) this:
> 
> setvar ttyE0   font            Boldface\\\ 16x32
> 
> An example in wscons.conf(5) indicating this would also be helpful.
> 
> -RVP
> 
> ---START---
> diff -u etc/rc.d.orig/wscons etc/rc.d/wscons
> --- etc/rc.d.orig/wscons	2011-08-09 08:08:10.000000000 +0000
> +++ etc/rc.d/wscons	2022-06-08 21:21:47.950605000 +0000
> @@ -87,7 +87,7 @@
>  						cmd="$cmd -e $enc"
>  						;;
>  				esac
> -				cmd="$cmd -N $name $file"
> +				cmd="$cmd -N \"$name\" \"$file\""
>  				eval $DOIT $cmd
>  				;;
> 
> ---END---

Uhm, you cite "setvar" in your example, but the patch affects handling
of the "font" command, it seems.

Can't we just fix the font name in wsfont/bold16x32.h to be
Boldface-16x32? :) Avoids confusion in wsfontload -l output too.

eval is nasty, but here we currently need it to undo the quoting of
the argument to -N (in your patch) or the extra backspace (before your
patch).

So I'd rather we avoid it altogether and rewrite the loop to consume
all the arguments first, then use the

    set -- "$@" ...

idiom to construct the command line, something along the lines of:

    set -- "$@" ${enc:+ "-e" "$enc"}
    set -- "$@" ${name:+ "-N" "$name"}
    set -- "$@" ${file:+ "-f" "$file"}
    $DOIT "$cmd" "$@"

PS: would be nice to have a version of echo that shqoute(3) its
arguments to use for DOIT too.

-uwe


Home | Main Index | Thread Index | Old Index