diff options
author | Stas Bekman <stas@stason.org> | 2003-03-10 23:35:52 +1100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-03-10 05:18:02 +0000 |
commit | 2307c6d0ffdaa48a896531d5bc3bf64c2dee420d (patch) | |
tree | f8f0f5796c4f922e600d38b1fb8af9dd3b94ed66 /pod/perlembed.pod | |
parent | 3c1e9986a4f0cb9d4e7a03af421826eb692ac840 (diff) | |
download | perl-2307c6d0ffdaa48a896531d5bc3bf64c2dee420d.tar.gz |
Bunch of doc patches from Stas; plus regen.
Subject: [doc patch] perl.c's pod api entry
Date: Mon, 10 Mar 2003 12:35:52 +1100
Message-ID: <3E6BEBF8.80402@stason.org>
Subject: Re: [patch] perlguts.pod
From: Stas Bekman <stas@stason.org>
Date: Mon, 10 Mar 2003 12:38:57 +1100
Message-ID: <3E6BECB1.7050009@stason.org>
Subject: Re: [PATCH ext/DynaLoader/DynaLoader_pm.PL] doc fix: s/dl_loadflags/dl_load_flags/
From: Stas Bekman <stas@stason.org>
Date: Mon, 10 Mar 2003 12:41:46 +1100
Message-ID: <3E6BED5A.801@stason.org>
Subject: Re: [patch] perlapi.pod fix
From: Stas Bekman <stas@stason.org>
Date: Mon, 10 Mar 2003 12:43:33 +1100
Message-ID: <3E6BEDC5.6010405@stason.org>
Subject: Re: [docs patch] replace gets() with fgets() in example
From: Stas Bekman <stas@stason.org>
Date: Mon, 10 Mar 2003 12:45:41 +1100
Message-ID: <3E6BEE45.9030901@stason.org>
Subject: [doc patch] perlrun.pod
From: Stas Bekman <stas@stason.org>
Date: Mon, 10 Mar 2003 14:49:59 +1100
Message-ID: <3E6C0B67.4050606@stason.org>
p4raw-id: //depot/perl@18873
Diffstat (limited to 'pod/perlembed.pod')
-rw-r--r-- | pod/perlembed.pod | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pod/perlembed.pod b/pod/perlembed.pod index 484884ea06..7d00c6473a 100644 --- a/pod/perlembed.pod +++ b/pod/perlembed.pod @@ -750,6 +750,8 @@ with L<perlfunc/my> whenever possible. #define DO_CLEAN 0 #endif + #define BUFFER_SIZE 1024 + static PerlInterpreter *my_perl = NULL; int @@ -757,7 +759,7 @@ with L<perlfunc/my> whenever possible. { char *embedding[] = { "", "persistent.pl" }; char *args[] = { "", DO_CLEAN, NULL }; - char filename [1024]; + char filename[BUFFER_SIZE]; int exitstatus = 0; STRLEN n_a; @@ -772,8 +774,10 @@ with L<perlfunc/my> whenever possible. if(!exitstatus) { exitstatus = perl_run(my_perl); - while(printf("Enter file name: ") && gets(filename)) { + while(printf("Enter file name: ") && + fgets(filename, BUFFER_SIZE, stdin)) { + filename[strlen(filename)-1] = '\0'; /* strip \n */ /* call the subroutine, passing it the filename as an argument */ args[0] = filename; call_argv("Embed::Persistent::eval_file", |