From 19aa4407da1934acd21d950f8d859d0db35c63ed Mon Sep 17 00:00:00 2001 From: Chris Timmons Date: Mon, 2 Feb 1998 05:42:16 +0000 Subject: [PATCH] Painless merge... --- contrib/global/gctags/ctags.h | 4 ++++ contrib/global/gtags/gtags.c | 4 ++-- contrib/global/lib/getdbpath.c | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/contrib/global/gctags/ctags.h b/contrib/global/gctags/ctags.h index 8deb2f9c8bf..e843032e423 100644 --- a/contrib/global/gctags/ctags.h +++ b/contrib/global/gctags/ctags.h @@ -33,6 +33,10 @@ * @(#)ctags.h 8.3 (Berkeley) 4/2/94 */ +/* Definition for gctags */ +#define GLOBAL 1 +#define YACC 1 + #define bool char #define YES 1 diff --git a/contrib/global/gtags/gtags.c b/contrib/global/gtags/gtags.c index 10d27a6dacd..288c16c1daf 100644 --- a/contrib/global/gtags/gtags.c +++ b/contrib/global/gtags/gtags.c @@ -270,9 +270,9 @@ int db; tagopen(dbpath, db, 1); for (findopen(); (path = findread(NULL)) != NULL; ) { /* - * GRTAGS and GSYMS doesn't treat asembler. + * GSYMS doesn't treat asembler. */ - if (db != GTAGS) { + if (db == GSYMS) { char *p = path + strlen(path) - 1; if ((*p == 's' || *p == 'S') && *(p - 1) == '.') continue; diff --git a/contrib/global/lib/getdbpath.c b/contrib/global/lib/getdbpath.c index fc4b6357987..1e4e7cfaeff 100644 --- a/contrib/global/lib/getdbpath.c +++ b/contrib/global/lib/getdbpath.c @@ -69,7 +69,7 @@ char *dbpath; if (bsd) { sprintf(path, "%s/%s/GTAGS", candidate, makeobjdir); if (test("fr", path)) { - sprintf(dbpath, "%s%s", candidate, makeobjdir); + sprintf(dbpath, "%s/%s", candidate, makeobjdir); return 1; } sprintf(path, "%s%s/GTAGS", makeobjdirprefix, candidate); @@ -126,7 +126,8 @@ char *dbpath; die("GTAGSROOT must be an absolute path."); if (stat(p, &sb) || !S_ISDIR(sb.st_mode)) die1("directory '%s' not found.", p); - strcpy(root, p); + if (realpath(p, root) == NULL) + die1("cannot get real path of '%s'.", p); /* * GTAGSDBPATH is meaningful only when GTAGSROOT exist. */