From 60b4982836a00ef6b2a97d16f735b3f6b74dce62 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 29 Nov 2016 16:18:24 +0100 Subject: gpg,sm: Merge the two versions of check_special_filename. * sm/gpgsm.c (check_special_filename): Move to .. * common/sysutils.c (check_special_filename): here. Add arg NOTRANSLATE. (allow_special_filenames): New local var. (enable_special_filenames): New public functions. * sm/gpgsm.c (allow_special_filenames): Remove var. (main): Call enable_special_filenames instead of setting the var. (open_read, open_es_fread, open_es_fwrite): Call check_special_filename with 0 for NOTRANSLATE. * common/iobuf.c (special_names_enabled): Remove var. (iobuf_enable_special_filenames): Remove func. (check_special_filename): Remove func. (iobuf_is_pipe_filename): Call new version of the function with NOTRANSLATE set. (do_open): Ditto. * g10/gpg.c (main): Call enable_special_filenames instead of iobuf_enable_special_filenames. * g10/gpgv.c (main): Ditto. -- Note that we keep the iobuf.c:translate_file_handle because it is a bit different (for whatever reasons) than the translate function from sysutils. Signed-off-by: Werner Koch --- common/iobuf.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'common/iobuf.h') diff --git a/common/iobuf.h b/common/iobuf.h index 4fa56609f..22e02daad 100644 --- a/common/iobuf.h +++ b/common/iobuf.h @@ -258,16 +258,10 @@ struct iobuf_struct #endif EXTERN_UNLESS_MAIN_MODULE int iobuf_debug_mode; -/* Whether iobuf_open, iobuf_create and iobuf_is_pipefilename - recognize special filenames. Special filenames are of the form - "-&nnnn" where n is a positive integer. The integer corresponds to - a file descriptor. Note: these functions always recognize the - special filename '-', which corresponds to standard input. */ -void iobuf_enable_special_filenames (int yes); /* Returns whether the specified filename corresponds to a pipe. In particular, this function checks if FNAME is "-" and, if special - filenames are enabled (see iobuf_enable_special_filenames), whether + filenames are enabled (see check_special_filename), whether FNAME is a special filename. */ int iobuf_is_pipe_filename (const char *fname); -- cgit v1.2.3