Skip to content
This repository
Browse code

git-svn-id: svn://cherokee-project.com/cherokee/trunk@2959 5dc97367-9…

…7f1-0310-9951-d761b3857238
  • Loading branch information...
commit 6b3a53016fe375c6ae5d2aa8d9812b8814634606 1 parent bb29719
Alvaro Lopez Ortega authored
3  ChangeLog
... ...
@@ -1,5 +1,8 @@
1 1
 2009-03-10  Alvaro Lopez Ortega  <alvaro@octality.com>
2 2
 
  3
+	* cherokee/handler_cgi_base.c, qa/210-Userdir_ScriptName.py: Tries
  4
+	to address: http://code.google.com/p/cherokee/issues/detail?id=377
  5
+
3 6
 	* qa/210-Userdir_ScriptName.py, qa/Makefile.am: Adds a new QA test
4 7
 	in order to reproduce the bug report #377:
5 8
 	http://code.google.com/p/cherokee/issues/detail?id=377
12  cherokee/handler_cgi_base.c
@@ -626,6 +626,11 @@ cherokee_handler_cgi_base_build_envp (cherokee_handler_cgi_base_t *cgi, cherokee
626 626
 		 * - If the SCGI is handling / it is ''
627 627
 		 * - Otherwise, it is the web_directory.
628 628
 		 */
  629
+		if (! cherokee_buffer_is_empty (&conn->userdir)) {
  630
+			cherokee_buffer_add_str    (&tmp, "/~");
  631
+			cherokee_buffer_add_buffer (&tmp, &conn->userdir);
  632
+		}
  633
+
629 634
 		if (conn->web_directory.len > 1) {
630 635
 			cgi->add_env_pair (cgi, "SCRIPT_NAME", 11, 
631 636
 					   conn->web_directory.buf, conn->web_directory.len);
@@ -653,7 +658,12 @@ cherokee_handler_cgi_base_build_envp (cherokee_handler_cgi_base_t *cgi, cherokee
653 658
 				len = name->len;
654 659
 			}
655 660
 		}
656  
-	
  661
+
  662
+		if (! cherokee_buffer_is_empty (&conn->userdir)) {
  663
+			cherokee_buffer_add_str    (&tmp, "/~");
  664
+			cherokee_buffer_add_buffer (&tmp, &conn->userdir);
  665
+		}
  666
+
657 667
 		if (conn->web_directory.len > 1) {
658 668
 			cherokee_buffer_add_buffer (&tmp, &conn->web_directory);
659 669
 		}
5  cherokee/handler_fcgi.c
@@ -418,7 +418,10 @@ add_extra_fcgi_env (cherokee_handler_fcgi_t *hdl, cuint_t *last_header_offset)
418 418
 	 */
419 419
 	*last_header_offset = hdl->write_buffer.len;
420 420
 
421  
-	set_env (cgi_base, "SCRIPT_FILENAME", cgi_base->executable.buf, cgi_base->executable.len);
  421
+	set_env (cgi_base, "SCRIPT_FILENAME",
  422
+		 cgi_base->executable.buf,
  423
+		 cgi_base->executable.len);
  424
+
422 425
 	TRACE (ENTRIES, "SCRIPT_FILENAME '%s'\n", cgi_base->executable.buf);
423 426
 
424 427
 	cherokee_buffer_mrproper (&buffer);
2  qa/210-Userdir_ScriptName.py
@@ -23,7 +23,7 @@
23 23
 CGI_BASE = """#!/bin/sh
24 24
 echo "Content-type: text/html"
25 25
 echo ""
26  
-echo "SCRIPT_NAME: -$SCRIPT_NAME-"
  26
+echo "SCRIPT_NAME: -${SCRIPT_NAME}-"
27 27
 """
28 28
 
29 29
 class Test (TestBase):

0 notes on commit 6b3a530

Please sign in to comment.
Something went wrong with that request. Please try again.