print_wwwfile_to_fd(outfile_fp,0);
print_wwwfile_to_fd(outfile_fp, FALSE);
PRIVATE void send_file_to_file ARGS3(	document *,	newdoc,	char *,		content_base,	char *,		sug_filename){    BOOLEAN FirstRecall = TRUE;    BOOLEAN use_cte;    CONST char *disp_charset;    FILE *outfile_fp;    char buffer[LY_MAXPATH];    char filename[LY_MAXPATH];    int FnameNum = -1;    int FnameTotal;    int c = 0;    _statusline(FILENAME_PROMPT);retry:    SetupFilename(filename, sug_filename);    if (lynx_save_space     && (strlen(lynx_save_space) + strlen(filename)) < sizeof(filename)) {	strcpy(buffer, lynx_save_space);	strcat(buffer, filename);	strcpy(filename, buffer);    }check_recall:    switch (RecallFilename(filename,    &FirstRecall, &FnameNum,			   &FnameTotal, PRINT_FLAG))  {	case FN_INIT:	    goto retry;	case FN_READ:	    goto check_recall;	case FN_QUIT:	    goto done;	default:	    break;    }    if (!LYValidateFilename(buffer, filename)) {	CancelPrint(SAVE_REQUEST_CANCELLED);    }    /*     * See if it already exists.     */    switch (LYValidateOutput(buffer)) {    case 'Y':	break;    case 'N':	_statusline(NEW_FILENAME_PROMPT);	FirstRecall = TRUE;	FnameNum = FnameTotal;	goto retry;    default:	goto done;    }    /*     * See if we can write to it.     */    CTRACE(tfp, "LYPrint: filename is %s, action is `%c'\n", buffer, c);#if HAVE_POPEN    if (*buffer == '|') {	if (no_shell) {	    HTUserMsg(SPAWNING_DISABLED);	    FirstRecall = TRUE;	    FnameNum = FnameTotal;	    goto retry;	} else if ((outfile_fp = popen(buffer+1, "w")) == NULL) {	    CTRACE(tfp, "LYPrint: errno is %d\n", errno);	    HTAlert(CANNOT_WRITE_TO_FILE);	    _statusline(NEW_FILENAME_PROMPT);	    FirstRecall = TRUE;	    FnameNum = FnameTotal;	    goto retry;	}    } else#endif    if ((outfile_fp = (TOUPPER(c) == 'A'	    ? LYAppendToTxtFile(buffer)	    : LYNewTxtFile(buffer))) == NULL) {	CTRACE(tfp, "LYPrint: errno is %d\n", errno);	HTAlert(CANNOT_WRITE_TO_FILE);	_statusline(NEW_FILENAME_PROMPT);	FirstRecall = TRUE;	FnameNum = FnameTotal;	goto retry;    }    if (LYPrependBaseToSource && HTisDocumentSource()) {	/*	 * Added the document's base as a BASE tag to the top of the file.  May	 * create technically invalid HTML, but will help get any partial or	 * relative URLs resolved properly if no BASE tag is present to replace	 * it.  - FM	 *	 * Add timestamp (last reload).	 */	fprintf(outfile_fp,		"<!-- X-URL: %s -->\n", newdoc->address);	if (HText_getDate() != NULL)	     fprintf(outfile_fp,		"<!-- Date: %s -->\n", HText_getDate());	fprintf(outfile_fp,		"<BASE HREF=\"%s\">\n", content_base);    }    if (LYPrependCharsetToSource && HTisDocumentSource()) {	/*	 * Added the document's charset as a META CHARSET tag to the top of the	 * file.  May create technically invalid HTML, but will help to resolve	 * properly the document converted via chartrans:  printed document	 * correspond to a display charset and we *should* override both	 * assume_local_charset and original document's META CHARSET (if any).	 *	 * Currently, if several META CHARSETs are found Lynx uses the first	 * only, and it is opposite to BASE where the original BASE in the	 * <HEAD> overrides ones from the top.	 *	 * As in print-to-email we write charset only if the document has 8-bit	 * characters, and we have no CJK or an unofficial "x-" charset.	 */	use_cte = HTLoadedDocumentEightbit();	disp_charset = LYCharSet_UC[current_char_set].MIMEname;	if (!use_cte || LYHaveCJKCharacterSet ||	    strncasecomp(disp_charset, "x-", 2) == 0) {	} else {	    fprintf(outfile_fp,		    "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=%s\">\n\n",		    disp_charset);	}    }    print_wwwfile_to_fd(outfile_fp,0);    if (keypad_mode)	printlist(outfile_fp,FALSE);#if HAVE_POPEN    if (LYIsPipeCommand(buffer))	pclose(outfile_fp);    else#endif    fclose(outfile_fp);#ifdef VMS    if (0 == strncasecomp(buffer, "sys$disk:", 9)) {	if (0 == strncmp((buffer+9), "[]", 2)) {	    HTAddSugFilename(buffer+11);	} else {	    HTAddSugFilename(buffer+9);	}    } else {	HTAddSugFilename(buffer);    }#else    HTAddSugFilename(buffer);#endif /* VMS */done:    return;}