[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Shorten symlinks in terminfo directories
From: |
Sven Joachim |
Subject: |
Shorten symlinks in terminfo directories |
Date: |
Wed, 16 Sep 2009 20:27:56 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
Hi,
I'm revising the patches in the Debian ncurses package. Thought you
might be interested in this one, created in version 5.5-2 by Daniel
Jacobowitz:
,----
| ncurses (5.5-2) unstable; urgency=low
| [...]
| * Use shorter symlinks within terminfo directories when possible
| (e.g. xx -> xy instead of xx -> ../x/xy).
|
| -- Daniel Jacobowitz <address@hidden> Sun, 30 Apr 2006 16:35:05 -0400
`----
---
ncurses/tinfo/write_entry.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--- a/ncurses/tinfo/write_entry.c
+++ b/ncurses/tinfo/write_entry.c
@@ -418,8 +418,13 @@
{
int code;
#if USE_SYMLINKS
- strcpy(symlinkname, "../");
- strncat(symlinkname, filename, sizeof(symlinkname) - 4);
+ if (first_name[0] == linkname[0])
+ strncpy (symlinkname, first_name, sizeof (symlinkname) - 1);
+ else
+ {
+ strcpy(symlinkname, "../");
+ strncat(symlinkname, filename, sizeof(symlinkname) - 4);
+ }
symlinkname[sizeof(symlinkname) - 1] = '\0';
#endif /* USE_SYMLINKS */
#if HAVE_REMOVE
(Of course, the indentation does not match your style.)
Cheers,
Sven
- Shorten symlinks in terminfo directories,
Sven Joachim <=