On Fri, Aug 18, 2017, at 18:51, Kurtis Rader wrote:
> Add this to the top of the function:
> 
> set -q language[1]
> or set language english

There is a potential problem with the above though.  If $language is set
to the empty string, the above code will not set language to english
[1].  I say potential because I don't know if that is a realistic cause
for a concern or a theoretical possibility that is highly unlikely.  In
either case, to handle a defined yet empty string, try these (from [1]):

string length -q -- $XYZ; or set XYZ whatever
# or
test -n "$XYZ"; or set XYZ whatever

[1] https://github.com/fish-shell/fish-shell/issues/3926

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to