comparison lib-src/etags.c @ 97694:83ddd0b1382b

(main): Do not use static space for the tagfile string.
author Francesco Potortì <pot@gnu.org>
date Mon, 25 Aug 2008 07:48:27 +0000
parents 3fde07bca9fa
children 0e63ee03a480
comparison
equal deleted inserted replaced
97693:2f75d2fff0a6 97694:83ddd0b1382b
77 * If you want to add support for a new language, start by looking at the LUA 77 * If you want to add support for a new language, start by looking at the LUA
78 * language, which is the simplest. Alternatively, consider distributing etags 78 * language, which is the simplest. Alternatively, consider distributing etags
79 * together with a configuration file containing regexp definitions for etags. 79 * together with a configuration file containing regexp definitions for etags.
80 */ 80 */
81 81
82 char pot_etags_version[] = "@(#) pot revision number is 17.38.1.3"; 82 char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
83 83
84 #define TRUE 1 84 #define TRUE 1
85 #define FALSE 0 85 #define FALSE 0
86 86
87 #ifdef DEBUG 87 #ifdef DEBUG
890 890
891 #ifndef EMACS_NAME 891 #ifndef EMACS_NAME
892 # define EMACS_NAME "standalone" 892 # define EMACS_NAME "standalone"
893 #endif 893 #endif
894 #ifndef VERSION 894 #ifndef VERSION
895 # define VERSION "17.38.1.3" 895 # define VERSION "17.38.1.4"
896 #endif 896 #endif
897 static void 897 static void
898 print_version () 898 print_version ()
899 { 899 {
900 /* Makes it easier to update automatically. */ 900 /* Makes it easier to update automatically. */
1249 suggest_asking_for_help (); 1249 suggest_asking_for_help ();
1250 /* NOTREACHED */ 1250 /* NOTREACHED */
1251 } 1251 }
1252 1252
1253 if (tagfile == NULL) 1253 if (tagfile == NULL)
1254 tagfile = CTAGS ? "tags" : "TAGS"; 1254 tagfile = savestr (CTAGS ? "tags" : "TAGS");
1255 cwd = etags_getcwd (); /* the current working directory */ 1255 cwd = etags_getcwd (); /* the current working directory */
1256 if (cwd[strlen (cwd) - 1] != '/') 1256 if (cwd[strlen (cwd) - 1] != '/')
1257 { 1257 {
1258 char *oldcwd = cwd; 1258 char *oldcwd = cwd;
1259 cwd = concat (oldcwd, "/", ""); 1259 cwd = concat (oldcwd, "/", "");
1260 free (oldcwd); 1260 free (oldcwd);
1261 } 1261 }
1262 /* Relative file names are made relative to the current directory. */ 1262
1263 /* Compute base directory for relative file names. */
1263 if (streq (tagfile, "-") 1264 if (streq (tagfile, "-")
1264 || strneq (tagfile, "/dev/", 5)) 1265 || strneq (tagfile, "/dev/", 5))
1265 tagfiledir = cwd; 1266 tagfiledir = cwd; /* relative file names are relative to cwd */
1266 else 1267 else
1267 { 1268 {
1268 canonicalize_filename (tagfile); 1269 canonicalize_filename (tagfile);
1269 tagfiledir = absolute_dirname (tagfile, cwd); 1270 tagfiledir = absolute_dirname (tagfile, cwd);
1270 } 1271 }