Ruby 1.9 RSTRING_LEN HP-UX arg0


#1

e$BEOJUE/Li$G$9!#e(B

ruby 1.9 e$B7O$G$9$,e(B RSTRING_LEN e$B%^%/%m$XJQ99$K$J$je(B
e$BBeF~$,$G$-$J$/$J$C$?$N$Ge(B HP-UX e$B$Ne(B arg0 e$B7O$NItJ,e(B
e$B$r8+D>$7$^$7$?!#e(B

e$B=$@5%Q%C%A$G$9!#$9$$$^$;$s$,e(B 1.9 e$B7O$K<h$j9~$s$Ge(B
e$B$/$@$5$$!#e(B

ruby 1.9.0 HP-UX 11.23 ia64 e$B$N8=>u$O!"e(Bminiruby
core e$B$7$F$^$9!#$3$N7o$O6a$/$^$H$a$F$+$iJL%a!<%ke(B
e$B$r$@$7$?$$$H;W$C$F$^$9!#e(B

e$B$h$m$7$/$*4j$$$7$^$9!#e(B


ruby.c.org 2007-05-18 20:26:09 +0900
+++ ruby.c 2007-05-22 16:17:32 +0900
@@ -1092,18 +1092,18 @@
s = RSTRING_PTR(val);
i = RSTRING_LEN(val);
#if defined(PSTAT_SETCMD)

  • if (i >= PST_CLEN) {
  • union pstun j;
  • j.pst_command = s;
  • i = PST_CLEN;
  • RSTRING_LEN(val) = i;
  • *(s + i) = ‘\0’;
  • pstat(PSTAT_SETCMD, j, PST_CLEN, 0, 0);
  • if (i > PST_CLEN) {
  • union pstun un;
  • char buf[PST_CLEN + 1]; /* PST_CLEN is 64 (HP-UX 11.23) */
  • strncpy(buf, s, PST_CLEN);
  • buf[PST_CLEN] = ‘\0’;
  • un.pst_command = buf;
  • pstat(PSTAT_SETCMD, un, PST_CLEN, 0, 0);
    }
    else {
  • union pstun j;
  • j.pst_command = s;
  • pstat(PSTAT_SETCMD, j, i, 0, 0);
  • union pstun un;
  • un.pst_command = s;
  • pstat(PSTAT_SETCMD, un, i, 0, 0);
    }
    rb_progname = rb_tainted_str_new(s, i);
    #elif defined(HAVE_SETPROCTITLE)