Deutsch   English   Français   Italiano  
<v408v8$29nhl$4@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: Lawrence D'Oliveiro <ldo@nz.invalid>
Newsgroups: comp.lang.c
Subject: Re: Running an editor from ANSI C
Date: Sat, 8 Jun 2024 00:34:49 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <v408v8$29nhl$4@dont-email.me>
References: <v3pge7$uf2i$1@dont-email.me> <v3r2pl$16mtl$1@dont-email.me>
	<v3r7v8$1b57j$1@dont-email.me> <v3rek5$1c4i5$1@dont-email.me>
	<v3rrtm$1e6g8$1@dont-email.me> <v3ru84$1eafb$1@dont-email.me>
	<87o78dzw1a.fsf@nosuchdomain.example.com> <v3te2i$1ms1q$1@dont-email.me>
	<87frtpznoa.fsf@nosuchdomain.example.com> <v3uimm$20jte$3@dont-email.me>
	<871q59yty1.fsf@nosuchdomain.example.com> <v3v03l$22nnp$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 08 Jun 2024 02:34:49 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="41ddd3104c6f00811ea81eed5288e7ff";
	logging-data="2416181"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19AJ1xqxtvmMnbKmuc4/6gc"
User-Agent: Pan/0.158 (Avdiivka; )
Cancel-Lock: sha1:WfukbtKfvQAesQqwqs1TcsIjZkM=
Bytes: 1822

On Fri, 7 Jun 2024 13:57:25 +0100, Malcolm McLean wrote:

> Now to get the $EDITOR variable I will have to modify this function.
> 
> int main(int argc, char **argv, char **envp)

No, actually you don’t. The environment block is odd, in that you can 
access it via getenv(3) and friends, without having to go through the 
argument list to main().

(And my man page says this is a “standard C library” routine, so no need 
for POSIX even.)

For some reason this does not apply to argc and argv. I’ve often wished it 
did.