public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* [Fwd: [21.1] work around cygwin readlink bug]
@ 2000-12-18 16:21 Charles S. Wilson
  2000-12-18 16:55 ` Christopher Faylor
  2000-12-18 23:04 ` Egor Duda
  0 siblings, 2 replies; 3+ messages in thread
From: Charles S. Wilson @ 2000-12-18 16:21 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 705 bytes --]

Saw this message on the xemacs-nt mailing list.  Is this a known bug in
cygwin-1.1.6 ?

--Chuck


-------- Original Message --------
Subject: [21.1] work around cygwin readlink bug
Date: Mon, 18 Dec 2000 16:54:05 +0000
From: Andy Piper <andyp@bea.com>
To: xemacs-patches@xemacs.org
CC: xemacs-nt@xemacs.org

Cygwin 1.1.6 seems to have introduced a bug in readlink which stop
runemacs 
working correctly. This patch works around it by forcing a trailing 0
after 
.exe.

andy

2000-12-18  Andy Piper  <andy@xemacs.org>

	* runemacs.c (WinMain): force a trailing 0 on the filename.
run.patch
--------------------------------------------------------------
Dr Andy Piper
Principal Consultant, BEA Systems Ltd


[-- Attachment #2: run.patch --]
[-- Type: text/x-diff, Size: 575 bytes --]

--- runemacs.c~	Mon Dec 18 16:48:11 2000
+++ runemacs.c	Mon Dec 18 16:44:23 2000
@@ -114,6 +114,12 @@
                 else
                   {
                     strcat(new_cmdline, "\\");
+		    /* #### Horrible kludge to get round 1.1.6 bug in readlink. */
+                    p = strrchr (real_name, '.');
+                    if (p[1] == 'e' || p[1] == 'E'
+			&& p[2] == 'x' || p[2] == 'X'
+			&& p[3] == 'e' || p[3] == 'E')
+		      p[4] = 0;
                     strcat(new_cmdline, real_name);
                     strcat(new_cmdline, " ");
                   }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Fwd: [21.1] work around cygwin readlink bug]
  2000-12-18 16:21 [Fwd: [21.1] work around cygwin readlink bug] Charles S. Wilson
@ 2000-12-18 16:55 ` Christopher Faylor
  2000-12-18 23:04 ` Egor Duda
  1 sibling, 0 replies; 3+ messages in thread
From: Christopher Faylor @ 2000-12-18 16:55 UTC (permalink / raw)
  To: cygwin

On Mon, Dec 18, 2000 at 07:21:06PM -0500, Charles S. Wilson wrote:
>Saw this message on the xemacs-nt mailing list.  Is this a known bug in
>cygwin-1.1.6 ?

READLINK(2)         Linux Programmer's Manual         READLINK(2)

NAME
       readlink - read value of a symbolic link

SYNOPSIS
       #include <unistd.h>

       int readlink(const char *path, char *buf, size_t bufsiz);

DESCRIPTION
       readlink  places the contents of the symbolic link path in
       the buffer buf, which has size bufsiz.  readlink does  not
       append  a NUL character to buf.  It will truncate the con-
       tents (to a length of  bufsiz  characters),  in  case  the
       buffer is too small to hold all of the contents.

I believe that the previous, incorrect behavior was discovered by
Egor Duda's test suite.

cgf

-------- Original Message --------
Subject: [21.1] work around cygwin readlink bug
Date: Mon, 18 Dec 2000 16:54:05 +0000
From: Andy Piper <andyp@bea.com>
To: xemacs-patches@xemacs.org
CC: xemacs-nt@xemacs.org

Cygwin 1.1.6 seems to have introduced a bug in readlink which stop
runemacs working correctly.  This patch works around it by forcing a
trailing 0 after .exe.


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Fwd: [21.1] work around cygwin readlink bug]
  2000-12-18 16:21 [Fwd: [21.1] work around cygwin readlink bug] Charles S. Wilson
  2000-12-18 16:55 ` Christopher Faylor
@ 2000-12-18 23:04 ` Egor Duda
  1 sibling, 0 replies; 3+ messages in thread
From: Egor Duda @ 2000-12-18 23:04 UTC (permalink / raw)
  To: Charles S. Wilson; +Cc: cygwin

Hi!

Tuesday, 19 December, 2000 Charles S. Wilson cwilson@ece.gatech.edu wrote:

CSW> Saw this message on the xemacs-nt mailing list.  Is this a known bug in
CSW> cygwin-1.1.6 ?

readlink() behavior was discussed in this thread

http://sources.redhat.com/ml/cygwin-patches/2000-q3/msg00050.html

i  believe  that  now  cygwin's readlink() complies with all standards
mentioned in that thread.

my  initial  patch  contained a stupid bug (i've used max() instead of
min()), wich was later corrected by Chris.

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19



--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-12-18 23:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-18 16:21 [Fwd: [21.1] work around cygwin readlink bug] Charles S. Wilson
2000-12-18 16:55 ` Christopher Faylor
2000-12-18 23:04 ` Egor Duda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).