Mercurial > emacs
comparison lib-src/etags.c @ 11886:c5db1295f7df
* etags.c (etags_getcwd): Use /bin/pwd instead of pwd because the
former gives the true path even in the presence of simlinks.
author | Francesco Potortì <pot@gnu.org> |
---|---|
date | Tue, 23 May 1995 15:40:31 +0000 |
parents | 46d2178719ad |
children | b95403bfc657 |
comparison
equal
deleted
inserted
replaced
11885:c686f5539749 | 11886:c5db1295f7df |
---|---|
30 #endif | 30 #endif |
31 * | 31 * |
32 * Francesco Potorti` (pot@cnuce.cnr.it) is the current maintainer. | 32 * Francesco Potorti` (pot@cnuce.cnr.it) is the current maintainer. |
33 */ | 33 */ |
34 | 34 |
35 char pot_etags_version[] = "@(#) pot revision number is 11.26"; | 35 char pot_etags_version[] = "@(#) pot revision number is 11.28"; |
36 | 36 |
37 #define TRUE 1 | 37 #define TRUE 1 |
38 #define FALSE 0 | 38 #define FALSE 0 |
39 #ifndef DEBUG | 39 #ifndef DEBUG |
40 # define DEBUG FALSE | 40 # define DEBUG FALSE |
3681 char *path = xnew (bufsize, char); | 3681 char *path = xnew (bufsize, char); |
3682 | 3682 |
3683 while (getcwd (path, bufsize) == NULL) | 3683 while (getcwd (path, bufsize) == NULL) |
3684 { | 3684 { |
3685 if (errno != ERANGE) | 3685 if (errno != ERANGE) |
3686 pfatal ("pwd"); | 3686 pfatal ("getcwd"); |
3687 bufsize *= 2; | 3687 bufsize *= 2; |
3688 path = xnew (bufsize, char); | 3688 path = xnew (bufsize, char); |
3689 } | 3689 } |
3690 | 3690 |
3691 return path; | 3691 return path; |
3694 { | 3694 { |
3695 struct linebuffer path; | 3695 struct linebuffer path; |
3696 FILE *pipe; | 3696 FILE *pipe; |
3697 | 3697 |
3698 initbuffer (&path); | 3698 initbuffer (&path); |
3699 pipe = (FILE *) popen ("pwd 2>/dev/null", "r"); | 3699 pipe = (FILE *) popen ("/bin/pwd 2>/dev/null", "r"); |
3700 if (pipe == NULL || readline_internal (&path, pipe) == 0) | 3700 if (pipe == NULL || readline_internal (&path, pipe) == 0) |
3701 pfatal ("pwd"); | 3701 pfatal ("/bin/pwd"); |
3702 pclose (pipe); | 3702 pclose (pipe); |
3703 | 3703 |
3704 return path.buffer; | 3704 return path.buffer; |
3705 } | 3705 } |
3706 #endif /* not DOS_NT and not HAVE_GETCWD */ | 3706 #endif /* not DOS_NT and not HAVE_GETCWD */ |