1--- src/man.c.orig	2006-06-02 12:52:27.000000000 -0700
2+++ src/man.c	2006-06-02 15:11:32.000000000 -0700
3@@ -335,7 +335,7 @@
4      if (expander && *expander) {
5 	  char *command;
6 
7-	  command = my_xsprintf ("%s %S", expander, name);
8+	  command = my_xsprintf ("%s '%Q'", expander, name);
9 	  fp = my_popen (command, "r");
10 	  if (fp == NULL) {
11 	       perror("popen");
12@@ -604,10 +604,10 @@
13 
14      if (expander && *expander) {
15 	  if (converter && *converter)
16-	     command = my_xsprintf("%s%s '%S' | %s%s",
17+	     command = my_xsprintf("%s%s '%Q' | %s%s",
18 				   bufh, expander, file, converter, buft);
19 	  else
20-	     command = my_xsprintf("%s%s '%S'%s",
21+	     command = my_xsprintf("%s%s '%Q'%s",
22 				   bufh, expander, file, buft);
23      } else if (ll || pl) {
24 	  const char *cat = getval("CAT");
25@@ -615,10 +615,10 @@
26 		  cat = "cat";
27 
28 	  if (converter && *converter)
29-	      command = my_xsprintf("%s%s '%S' | %s%s",
30+	      command = my_xsprintf("%s%s '%Q' | %s%s",
31 				    bufh, cat, file, converter, buft);
32 	  else
33-	      command = my_xsprintf("%s%s '%S'%s",
34+	      command = my_xsprintf("%s%s '%Q'%s",
35 				    bufh, cat, file, buft);
36      }
37 
38@@ -641,7 +641,7 @@
39      }
40 
41      if (expander && *expander) {
42-	  char *cmd = my_xsprintf ("%s %S", expander, file);
43+	  char *cmd = my_xsprintf ("%s '%Q'", expander, file);
44 	  fp = my_popen (cmd, "r");
45 	  if (fp == NULL) {
46 	       perror("popen");
47@@ -826,9 +826,9 @@
48      if (roff_command == NULL)
49 	  return 0;
50      if (do_troff)
51-	  command = my_xsprintf ("(cd %S && %s)", path, roff_command);
52+	  command = my_xsprintf ("(cd '%Q' && %s)", path, roff_command);
53      else
54-	  command = my_xsprintf ("(cd %S && %s | (%s || true))", path,
55+	  command = my_xsprintf ("(cd '%Q' && %s | (%s || true))", path,
56 		   roff_command, pager);
57 
58      return !do_system_command (command, 0);
59