perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: modperl-2.0/xs/Apache/SubProcess Apache__SubProcess.h
Date Tue, 18 Dec 2001 03:44:33 GMT
dougm       01/12/17 19:44:33

  Modified:    xs/Apache/SubProcess Apache__SubProcess.h
  Log:
  dont bother creating an empty av_argv if no args are passed into spawn_proc_prog
  
  Revision  Changes    Path
  1.5       +7 -10     modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h
  
  Index: Apache__SubProcess.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Apache__SubProcess.h	2001/12/18 03:40:02	1.4
  +++ Apache__SubProcess.h	2001/12/18 03:44:33	1.5
  @@ -113,15 +113,15 @@
           apr_file_t *script_in, *script_out, *script_err;
           apr_status_t rc;
           const char **argv;
  -        int i;
  -        AV *av_argv;
  +        int i=0;
  +        AV *av_argv = Nullav;
           I32 len=-1, av_items=0;
           request_rec *r = modperl_xs_sv2request_rec(aTHX_ ST(0), NULL, cv);
           const char *command = (const char *)SvPV_nolen(ST(1));
   
           if (items == 3) {
               if (SvROK(ST(2)) && SvTYPE(SvRV(ST(2))) == SVt_PVAV) {
  -                av_argv = (AV*)SvREFCNT_inc(SvRV(ST(2)));
  +                av_argv = (AV*)SvRV(ST(2));
                   len = AvFILLp(av_argv);
                   av_items = len+1;
               }
  @@ -129,9 +129,6 @@
                   Perl_croak(aTHX_ usage);
               }
           }
  -        else {
  -            av_argv = newAV();
  -        }
   
           /* ap_os_create_privileged_process expects ARGV as char
            * **argv, with terminating NULL and the program itself as a
  @@ -139,8 +136,10 @@
            */
           argv = apr_palloc(r->pool, (av_items + 2) * sizeof(char *));
           argv[0] = command;
  -        for (i = 0; i <= len; i++) {
  -            argv[i+1] = (const char *)SvPV_nolen(AvARRAY(av_argv)[i]);
  +        if (av_argv) {
  +            for (i = 0; i <= len; i++) {
  +                argv[i+1] = (const char *)SvPV_nolen(AvARRAY(av_argv)[i]);
  +            }
           }
           argv[i+1] = NULL;
   #if 0
  @@ -152,8 +151,6 @@
           rc = modperl_spawn_proc_prog(r, command, &argv,
                                        &script_in, &script_out,
                                        &script_err);
  -
  -        SvREFCNT_dec(av_argv);
   
           if (rc == APR_SUCCESS) {
               /* XXX: apr_file_to_glob should be set once in the BOOT: section */
  
  
  

Mime
View raw message