Revision 4d224196 vl.c

b/vl.c
4625 4625
    char *dir;
4626 4626
    char *p = NULL;
4627 4627
    char *res;
4628
#ifdef PATH_MAX
4629 4628
    char buf[PATH_MAX];
4630
#endif
4631 4629
    size_t max_len;
4632 4630

  
4633 4631
#if defined(__linux__)
......
4652 4650
    /* If we don't have any way of figuring out the actual executable
4653 4651
       location then try argv[0].  */
4654 4652
    if (!p) {
4655
#ifdef PATH_MAX
4656
        p = buf;
4657
#endif
4658
        p = realpath(argv0, p);
4653
        p = realpath(argv0, buf);
4659 4654
        if (!p) {
4660 4655
            return NULL;
4661 4656
        }
......
4674 4669
            res = NULL;
4675 4670
        }
4676 4671
    }
4677
#ifndef PATH_MAX
4678
    free(p);
4679
#endif
4672

  
4680 4673
    return res;
4681 4674
}
4682 4675
#undef SHARE_SUFFIX

Also available in: Unified diff