Sujet : Re: Running an editor from ANSI C
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.cDate : 08. Jun 2024, 01:34:49
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v408v8$29nhl$4@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : Pan/0.158 (Avdiivka; )
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.