Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <vbv4ra$b0hv$2@dont-email.me>
Deutsch   English   Français   Italiano  
<vbv4ra$b0hv$2@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: Command line globber/tokenizer library for C?
Date: Thu, 12 Sep 2024 17:28:27 +0100
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <vbv4ra$b0hv$2@dont-email.me>
References: <lkbjchFebk9U1@mid.individual.net>
 <vbs1om$3jkch$1@raubtier-asyl.eternal-september.org>
 <vbsb94$1rsji$1@news.xmission.com>
 <vbsmlb$3o6n2$1@raubtier-asyl.eternal-september.org>
 <vbsu1d$3p7pp$1@dont-email.me>
 <vbtj88$1kpm$1@raubtier-asyl.eternal-september.org>
 <vbujak$733i$3@dont-email.me> <vbum9i$8h2o$1@dont-email.me>
 <vbur72$99cr$1@dont-email.me> <20240912181625.00006e68@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 12 Sep 2024 18:28:26 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3a3e703b62fd17d38a4df729837e6247";
	logging-data="361023"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19qbuWI/5A4GSbXyxSStSES"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:b/vpnpvn6nIygPHmob4f+AcvCKM=
Content-Language: en-GB
In-Reply-To: <20240912181625.00006e68@yahoo.com>
Bytes: 2719

On 12/09/2024 16:16, Michael S wrote:
> On Thu, 12 Sep 2024 14:44:03 +0100
> Bart <bc@freeuk.com> wrote:

> Apart from unnecessary ilen limit, of unnecessary goto into block (I
> have nothing against forward gotos out of blocks, but gotos into blocks
> make me nervous) and of variable 'length' that serves no purpose, your
> code simply does not fulfill requirements of OP.
> I can immediately see two gotchas: no handling of escaped double
> quotation marks \" and no handling of single quotation marks. Quite
> possibly there are additional omissions.

BM's C++ version doesn't handle embedded quotes or single quotes either. 
Neither expand wildcards into sequences of filename arguments.

But you're right about 'length' which in the end was not used. It makes 
the C version even smaller without it.

I wasn't trying to match the OP's requirements, as I don't know what 
they are.

If this has to exactly match how the OS parses the command line into 
separate parameters, then that's likely to be a significantly more 
complex program, especially if it is to run on Linux.

There's probably no point in trying to create such program; you'd need 
to find a way of utilising the OS to do the work.

Note that I wasn't posting to solve the OP's problem, but as a 
counter-example to that C++ code which literally hurt my eyes to look at.