-
- /* If BUFFER is nil, we must read process output once and then
- discard it, so setup coding system but with nil. If BUFFER is
- an integer, we can discard it without reading. */
- if (nargs < 3 || NILP (args[2]))
- setup_coding_system (Qnil, &process_coding);
- else if (!INTEGERP (args[2]))
- {
- val = Qnil;
- if (!NILP (Vcoding_system_for_read))
- val = Vcoding_system_for_read;
- else if (NILP (current_buffer->enable_multibyte_characters))
- val = Qraw_text;
- else
- {
- if (!EQ (coding_systems, Qt))
- {
- args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2);
- args2[0] = Qcall_process;
- for (i = 0; i < nargs; i++) args2[i + 1] = args[i];
- coding_systems
- = Ffind_operation_coding_system (nargs + 1, args2);
- }
- if (CONSP (coding_systems))
- val = XCONS (coding_systems)->car;
- else if (CONSP (Vdefault_process_coding_system))
- val = XCONS (Vdefault_process_coding_system)->car;
- else
- val = Qnil;
- }
- setup_coding_system (Fcheck_coding_system (val), &process_coding);
-#ifdef MSDOS
- /* On MSDOS, if the user did not ask for binary, treat it as
- "text" which means doing CRLF conversion. Otherwise, leave
- the EOLs alone.
-
- Note that ``binary'' here only means whether EOLs should or
- should not be converted, since that's what Vbinary_process_XXXput
- meant in the days before the coding systems were introduced.
-
- For other conversions, the caller should set coding-system
- variables explicitly, or rely on auto-detection. */
-
- /* FIXME: this probably should be moved into the guts of
- `Ffind_operation_coding_system' for the case of `call-process'. */
- if (NILP (Vbinary_process_output))
- {
- process_coding.eol_type = CODING_EOL_CRLF;
- if (process_coding.type == coding_type_no_conversion)
- /* FIXME: should we set type to undecided? */
- process_coding.type = coding_type_emacs_mule;
- }
- else
- process_coding.eol_type = CODING_EOL_LF;
-#endif
- }