aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorEli Zaretskii2016-02-02 20:01:33 +0200
committerEli Zaretskii2016-02-02 20:01:33 +0200
commitf6213ce79981747b3cb2c8213710986b93999fe5 (patch)
tree79eb99c5cbcb1e401935d58af902a1ce379782f8 /lib-src
parente42e662f26523ba0d10c41ab6deead85077c9f79 (diff)
downloademacs-f6213ce79981747b3cb2c8213710986b93999fe5.tar.gz
emacs-f6213ce79981747b3cb2c8213710986b93999fe5.zip
Fix file-name recognition in 'etags'
* lib-src/etags.c (get_language_from_filename): If FILE includes a leading directory, compare only its basename to the known file names in lang_names[]. * test/etags/Makefile (RBSRC): Adapt to recent test1.ruby renaming. * test/etags/ETAGS.good_1: * test/etags/ETAGS.good_2: * test/etags/ETAGS.good_3: * test/etags/ETAGS.good_4: * test/etags/ETAGS.good_5: * test/etags/ETAGS.good_6: * test/etags/CTAGS.good: Adapt to changes in Ruby file names and to the results in Makefile due to the above etags.c fix.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/etags.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c
index acf20ddceb9..760685a6693 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -1485,8 +1485,16 @@ get_language_from_filename (char *file, int case_sensitive)
1485{ 1485{
1486 language *lang; 1486 language *lang;
1487 const char **name, **ext, *suffix; 1487 const char **name, **ext, *suffix;
1488 char *slash;
1488 1489
1489 /* Try whole file name first. */ 1490 /* Try whole file name first. */
1491 slash = strrchr (file, '/');
1492 if (slash != NULL)
1493 file = slash + 1;
1494#ifdef DOS_NT
1495 else if (file[0] && file[1] == ':')
1496 file += 2;
1497#endif
1490 for (lang = lang_names; lang->name != NULL; lang++) 1498 for (lang = lang_names; lang->name != NULL; lang++)
1491 if (lang->filenames != NULL) 1499 if (lang->filenames != NULL)
1492 for (name = lang->filenames; *name != NULL; name++) 1500 for (name = lang->filenames; *name != NULL; name++)