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

Re: virtual hosts



* David N. Welton (davidw@dedasys.com) wrote :
> Matthew Wilcox <willy@debian.org> writes:
> 
> > Is the sort guaranteed to be done in ASCII order?  If so, prefixing
> > with a ! will get it in first since ! isn't a valid character in a
> > hostname.  If the sort order is LC_COLLATE dependent then we're
> > buggered.
> 
> It's sorted like so:
> 
>             qsort((void *) candidates->elts, candidates->nelts,
>                   sizeof(fnames), fname_alphasort);
> 
> ...
> 
> static int fname_alphasort(const void *fn1, const void *fn2)
> {
>     const fnames *f1 = fn1;
>     const fnames *f2 = fn2;
> 
>     return strcmp(f1->fname,f2->fname);
> }
> 
> So I guess we should be ok.  Are there any other characters that are
> less meaningful in shell terms?  @ or + maybe?  Still feels kind of
> dirty to me.  Oh well...
> 
it's a bit nasty, agreed. But I think !DEFAULT or similar would get the
point across quite well...
-Thom



Reply to: