summaryrefslogtreecommitdiff
path: root/textproc/migemo/patches/patch-migemo-server
blob: 47c0c80e39ec686e469306b16992586643fc281a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
$NetBSD: patch-migemo-server,v 1.1 2012/08/12 11:52:27 obache Exp $

--- migemo-server.orig	2001-08-13 09:30:51.000000000 +0000
+++ migemo-server
@@ -1,4 +1,4 @@
-#! /usr/bin/env ruby
+#! /usr/bin/env ruby -Ke
 #
 # migemo-server
 #
@@ -10,7 +10,6 @@
 # the GNU General Public License version 2.
 #
 
-$KCODE = "e"
 require 'migemo'
 require 'cgi'
 require 'socket'
@@ -73,7 +72,7 @@ class MigemoServer
   end
 
   def print_form (socket)
-    print_http (socket, 
+    print_http(socket, 
 		['HTTP/1.0 200', 
 		  'Content-type: text/html'], 
 		<<"EOF")
@@ -111,7 +110,7 @@ EOF
 
   def print_http (socket, header, body)
     header.each { |h| socket.syswrite h + CRLF }
-    socket.syswrite 'Content-Length: ' + body.size.to_s + CRLF
+    socket.syswrite 'Content-Length: ' + body.bytesize.to_s + CRLF
     socket.syswrite CRLF
     socket.syswrite body
   end