etags screw filenames starting with ./
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
emacs23 (Fedora) |
Fix Released
|
Medium
|
|||
emacs23 (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
exuberant-ctags (Debian) |
Fix Released
|
Unknown
|
|||
exuberant-ctags (Ubuntu) |
Fix Released
|
Medium
|
Colin Watson |
Bug Description
Binary package hint: exuberant-ctags
when running etags using following form:
find . -name '*.[hc]' | xargs etags -a
The generated TAGS file contains wrong file names.
The same problem exists with etags problem coming from emacs23 package
Works correctly with :
find ../<upperdir>/. -name '*.[hc]' | xargs etags -a
The same problem reported here: https:/
ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: exuberant-ctags 1:5.8-2
ProcVersionSign
Uname: Linux 2.6.32-22-generic x86_64
NonfreeKernelMo
Architecture: amd64
Date: Tue May 18 18:19:43 2010
InstallationMedia: Kubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100427)
ProcEnviron:
LANGUAGE=
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: exuberant-ctags
Related branches
- Ubuntu branches: Pending requested
- Diff: 36701 lines
Changed in exuberant-ctags (Debian): | |
status: | Unknown → Fix Released |
Changed in emacs23 (Fedora): | |
importance: | Unknown → Medium |
status: | Unknown → Fix Released |
Created attachment 376898
Patch for the problem described, replacing strcpy with memmove.
Description of problem:
This is a bug against etags.emacs which is packaged in emacs-common, but there is no separate component called emacs-common. This same bug exists in etags.xemacs, packaged in xemacs-common.
When etags is run with filenames starting with "./", it normalizes them to start without "./", but does so incorrectly, messing up the result.
Version-Release number of selected component (if applicable): 23.1-13. fc12.x86_ 64 common- 21.5.29- 8.fc12. x86_64
emacs-common-
xemacs-
How reproducible:
100%
Steps to Reproduce: etags.emacs ./src/gdk/ gdk_atoms. c
1. Create a file with a C function and path e.g. src/gdk/gdk_atoms.c
2. Run /usr/bin/
3. Observe the filename in TAGS
Actual results:
The filename recorded in the TAGS file is src/gdk/gdk_otoms.c (note "o" after underscore).
Expected results:
The filename should be src/gdk/gdk_atoms.c
Additional info:
The problem is a call to strcpy on overlapping buffers. In Fedora 11 and before that seems to have worked, but in Fedora 12 it often does not work, at least not for slightly longer filenames.
The attached patch should also work for etags.xemacs in xemacs-common, except for differing line numbers.