Ignore:
Timestamp:
Jan 25, 2007, 12:59:33 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Oops, fix in-tree preloading!
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/zzuf.c

    r1706 r1707  
    6767
    6868static void loop_stdin(struct opts *);
    69 static int run_process(char const *[]);
     69static int run_process(char const *, char *[]);
    7070
    7171static void spawn_children(struct opts *);
     
    353353
    354354    /* Create new argv */
     355    opts->oldargv = argv;
    355356    opts->newargv = malloc((argc - optind + 1) * sizeof(char *));
    356357    memcpy(opts->newargv, argv + optind, (argc - optind) * sizeof(char *));
     
    576577
    577578#if defined HAVE_FORK
    578         if(run_process(opts->newargv) < 0)
     579        if(run_process(opts->oldargv[0], opts->newargv) < 0)
    579580            exit(EXIT_FAILURE);
    580581        exit(EXIT_SUCCESS);
    581582#else
    582         if(run_process(opts->newargv) < 0)
     583        if(run_process(opts->oldargv[0], opts->newargv) < 0)
    583584            return;
    584585#endif
     
    838839#endif
    839840
    840 static int run_process(char const *argv[])
     841static int run_process(char const *zzuf_exe, char *argv[])
    841842{
    842843#if defined HAVE_FORK
    843844    char *libpath, *tmp;
    844     int ret, len = strlen(argv[0]);
     845    int ret, len = strlen(zzuf_exe);
    845846#   if defined __APPLE__
    846847#       define FILENAME "libzzuf.dylib"
     
    859860
    860861    libpath = malloc(len + strlen("/.libs/" FILENAME EXTRAINFO) + 1);
    861     strcpy(libpath, argv[0]);
     862    strcpy(libpath, zzuf_exe);
    862863
    863864    tmp = strrchr(libpath, '/');
Note: See TracChangeset for help on using the changeset viewer.