[#4745] Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...>

Having taken upon me the task to provide a Windows build for

24 messages 2005/04/20
[#4746] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Austin Ziegler <halostatue@...> 2005/04/20

On 4/20/05, Erik Huelsmann <ehuels@gmail.com> wrote:

[#4747] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...> 2005/04/20

Hi Austin,

[#4762] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — nobu.nokada@... 2005/04/24

Hi,

[#4783] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...> 2005/04/25

On 4/24/05, nobu.nokada@softhome.net <nobu.nokada@softhome.net> wrote:

[#4787] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — nobu.nokada@... 2005/04/25

Hi,

[#4794] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...> 2005/04/25

> > > Ruby is just using AC_TYPE_UID_T. So, using typedef for them,

[#4751] Illegal regexp causes segfault — Andrew Walrond <andrew@...>

irb(main):058:0> a = /\[([^]]*)\]/

13 messages 2005/04/22

Re: [PATCH] enhanced $0 modification

From: nobu.nokada@...
Date: 2005-04-27 14:30:39 UTC
List: ruby-core #4804
Hi,

At Wed, 27 Apr 2005 11:25:02 +0900,
Evan Webb wrote in [ruby-core:04801]:
> The update patch shares no code with original ProFTPD, and thus would
> not be copied or even derivated. But the update version is against
> head isnt it? It didnt apply cleanly to by 1.8.2, so i'm assuming it
> is. At any rate, I'd to see it make it into head and 1.8.

Yes, to HEAD of trunk.  And it didn't work after modifying ENV.


* ruby.c (set_arg0): use also environment variable space for setting
  $0.  [ruby-core:04774]


Index: ruby.c
===================================================================
RCS file: /cvs/ruby/src/ruby/ruby.c,v
retrieving revision 1.98
diff -U2 -p -u -r1.98 ruby.c
--- ruby.c	20 Apr 2005 21:44:20 -0000	1.98
+++ ruby.c	27 Apr 2005 02:24:19 -0000
@@ -978,4 +978,31 @@ VALUE rb_argv;
 VALUE rb_argv0;
 
+#if !defined(PSTAT_SETCMD) && !defined(HAVE_SETPROCTITLE) && !defined(DOSISH)
+static struct {
+    char *begin, *end;
+} envspace;
+extern char **environ;
+
+static void
+set_arg0space()
+{
+    char *s;
+    int i;
+
+    if (!environ || (s = environ[0]) == NULL) return;
+    envspace.begin = s;
+    s += strlen(s);
+    for (i = 1; environ[i]; i++) {
+	if (environ[i] == s + 1) {
+	    s++;
+	    s += strlen(s);	/* this one is ok too */
+	}
+    }
+    envspace.end = s;
+}
+#else
+#define set_arg0space() ((void)0)
+#endif
+
 static void
 set_arg0(val, id)
@@ -991,5 +1018,5 @@ set_arg0(val, id)
     s = RSTRING(val)->ptr;
     i = RSTRING(val)->len;
-#ifdef __hpux
+#if defined(PSTAT_SETCMD)
     if (i >= PST_CLEN) {
       union pstun j;
@@ -1025,4 +1052,10 @@ set_arg0(val, id)
 	    }
 	}
+#ifndef DOSISH
+	if (s + 1 == envspace.begin) {
+	    s = envspace.end;
+	    ruby_setenv("", NULL); /* duplicate environ vars */
+	}
+#endif
 	len = s - origargv[0];
     }
@@ -1175,4 +1208,5 @@ ruby_process_options(argc, argv)
     dln_argv0 = argv[0];
 #endif
+    set_arg0space();
     proc_options(argc, argv);
 


-- 
Nobu Nakada

In This Thread