[Bug 705308] New: etags (in ctags package) corrupts file names when normalising them.
https://bugzilla.novell.com/show_bug.cgi?id=705308
https://bugzilla.novell.com/show_bug.cgi?id=705308#c0
Summary: etags (in ctags package) corrupts file names when
normalising them.
Classification: openSUSE
Product: openSUSE 11.4
Version: Factory
Platform: x86-64
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Basesystem
AssignedTo: puzel@novell.com
ReportedBy: nfbrown@novell.com
QAContact: qa@suse.de
CC: aj@suse.de
Found By: ---
Blocker: ---
If I run
etags `find . -name '*.[ch]'`
to generate a TAGS file for all source in a directory tree the resulting TAGS
file will be corrupted.
The corruption happens as part of normalising the file name - files will be
given as e.g. ./dir/file.c and etags wants to use "dir/file.c" in the TAGS
file.
The 'absolule_filename' function is used as part of the normalisation. When it
finds "/./" in the path name it uses:
strcpy(slashp, slashp+2)
to make the "./" disappear.
This is not allowed and does not work reliably. The documentation for strcpy
says explicitly "The strings may not overlap" but in this case they do.
This sometimes works with the current glibc but sometimes doesn't. In
particular if "slashp" is a multiple of 16 plus 3, it doesn't work. The
following sample code reliably prints "inclede" where you would expect
"include"
#include
https://bugzilla.novell.com/show_bug.cgi?id=705308
https://bugzilla.novell.com/show_bug.cgi?id=705308#c
Petr Uzel
https://bugzilla.novell.com/show_bug.cgi?id=705308
https://bugzilla.novell.com/show_bug.cgi?id=705308#c1
Petr Uzel
https://bugzilla.novell.com/show_bug.cgi?id=705308
https://bugzilla.novell.com/show_bug.cgi?id=705308#c2
Neil Brown
https://bugzilla.novell.com/show_bug.cgi?id=705308
https://bugzilla.novell.com/show_bug.cgi?id=705308#c3
Petr Uzel
participants (1)
-
bugzilla_noreply@novell.com