+/* The idea here was to quote ? as %3F to avoid passing part of the
+ file name as the parameter when browsing the converted file through
+ HTTP. However, actually doing that breaks local browsing because
+ "index.html%3Ffoo=bar" isn't even recognized as an HTML file!
+ Perhaps this should be controlled by an option, but for now I'm
+ leaving the question marks.
+
+ This is the original docstring of this function:
+
+ FILE should be a relative link to a local file. It should be
+ quoted as HTML because it will be used in HTML context. However,
+ we need to quote ? as %3F to avoid passing part of the file name as
+ the parameter. (This is not a problem when viewing locally, but is
+ if the downloaded and converted tree is served by an HTTP
+ server.) */
+
+/* Quote string as HTML. */
+
+static char *
+local_quote_string (const char *file)
+{
+ return html_quote_string (file);
+
+#if 0
+ const char *file_sans_qmark;
+ int qm = count_char (file, '?');
+
+ if (qm)
+ {
+ const char *from = file;
+ char *to, *newname;
+
+ /* qm * 2 because we replace each question mark with "%3F",
+ i.e. replace one char with three, hence two more. */
+ int fsqlen = strlen (file) + qm * 2;
+
+ to = newname = (char *)alloca (fsqlen + 1);
+ for (; *from; from++)
+ {
+ if (*from != '?')
+ *to++ = *from;
+ else
+ {
+ *to++ = '%';
+ *to++ = '3';
+ *to++ = 'F';
+ }
+ }
+ assert (to - newname == fsqlen);
+ *to = '\0';
+
+ file_sans_qmark = newname;
+ }
+ else
+ file_sans_qmark = file;
+
+ return html_quote_string (file_sans_qmark);
+#endif
+}
+