diff options
Diffstat (limited to 'src/metaflac')
-rw-r--r-- | src/metaflac/operations.c | 4 | ||||
-rw-r--r-- | src/metaflac/operations_shorthand_cuesheet.c | 16 | ||||
-rw-r--r-- | src/metaflac/operations_shorthand_seektable.c | 4 | ||||
-rw-r--r-- | src/metaflac/operations_shorthand_streaminfo.c | 4 | ||||
-rw-r--r-- | src/metaflac/operations_shorthand_vorbiscomment.c | 11 | ||||
-rw-r--r-- | src/metaflac/options.c | 4 | ||||
-rw-r--r-- | src/metaflac/usage.c | 4 | ||||
-rw-r--r-- | src/metaflac/utils.c | 4 |
8 files changed, 45 insertions, 6 deletions
diff --git a/src/metaflac/operations.c b/src/metaflac/operations.c index dd81039a..173c091b 100644 --- a/src/metaflac/operations.c +++ b/src/metaflac/operations.c @@ -16,6 +16,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#if HAVE_CONFIG_H +# include <config.h> +#endif + #include "operations.h" #include "usage.h" #include "utils.h" diff --git a/src/metaflac/operations_shorthand_cuesheet.c b/src/metaflac/operations_shorthand_cuesheet.c index a4d11a08..bd37fd45 100644 --- a/src/metaflac/operations_shorthand_cuesheet.c +++ b/src/metaflac/operations_shorthand_cuesheet.c @@ -16,11 +16,17 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#if HAVE_CONFIG_H +# include <config.h> +#endif + +#include <errno.h> +#include <stdio.h> /* for snprintf() */ +#include <string.h> #include "options.h" #include "utils.h" #include "FLAC/assert.h" #include "share/grabbag.h" -#include <string.h> static FLAC__bool import_cs_from(const char *filename, FLAC__StreamMetadata **cuesheet, const char *cs_filename, FLAC__bool *needs_write, FLAC__uint64 lead_out_offset, FLAC__bool is_cdda, Argument_AddSeekpoint *add_seekpoint_link); static FLAC__bool export_cs_to(const char *filename, const FLAC__StreamMetadata *cuesheet, const char *cs_filename); @@ -118,7 +124,7 @@ FLAC__bool import_cs_from(const char *filename, FLAC__StreamMetadata **cuesheet, f = fopen(cs_filename, "r"); if(0 == f) { - fprintf(stderr, "%s: ERROR: can't open import file %s\n", filename, cs_filename); + fprintf(stderr, "%s: ERROR: can't open import file %s: %s\n", filename, cs_filename, strerror(errno)); return false; } @@ -183,7 +189,7 @@ FLAC__bool export_cs_to(const char *filename, const FLAC__StreamMetadata *cueshe f = fopen(cs_filename, "w"); if(0 == f) { - fprintf(stderr, "%s: ERROR: can't open export file %s\n", filename, cs_filename); + fprintf(stderr, "%s: ERROR: can't open export file %s: %s\n", filename, cs_filename, strerror(errno)); return false; } @@ -193,7 +199,11 @@ FLAC__bool export_cs_to(const char *filename, const FLAC__StreamMetadata *cueshe return false; } +#ifdef _MSC_VER + _snprintf(ref, reflen, "\"%s\" FLAC", filename); +#else snprintf(ref, reflen, "\"%s\" FLAC", filename); +#endif grabbag__cuesheet_emit(f, cuesheet, ref); diff --git a/src/metaflac/operations_shorthand_seektable.c b/src/metaflac/operations_shorthand_seektable.c index 8ab93e28..51ba63e4 100644 --- a/src/metaflac/operations_shorthand_seektable.c +++ b/src/metaflac/operations_shorthand_seektable.c @@ -16,6 +16,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#if HAVE_CONFIG_H +# include <config.h> +#endif + #include "utils.h" #include "FLAC/assert.h" #include "FLAC/file_decoder.h" diff --git a/src/metaflac/operations_shorthand_streaminfo.c b/src/metaflac/operations_shorthand_streaminfo.c index f9d729f9..738bec01 100644 --- a/src/metaflac/operations_shorthand_streaminfo.c +++ b/src/metaflac/operations_shorthand_streaminfo.c @@ -16,6 +16,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#if HAVE_CONFIG_H +# include <config.h> +#endif + #include "options.h" #include "utils.h" #include "FLAC/assert.h" diff --git a/src/metaflac/operations_shorthand_vorbiscomment.c b/src/metaflac/operations_shorthand_vorbiscomment.c index e28cbb5c..700cdb44 100644 --- a/src/metaflac/operations_shorthand_vorbiscomment.c +++ b/src/metaflac/operations_shorthand_vorbiscomment.c @@ -16,11 +16,16 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#if HAVE_CONFIG_H +# include <config.h> +#endif + #include "options.h" #include "utils.h" #include "FLAC/assert.h" #include "share/grabbag.h" /* for grabbag__file_get_filesize() */ #include "share/utf8.h" +#include <errno.h> #include <stdlib.h> #include <string.h> @@ -195,10 +200,10 @@ FLAC__bool set_vc_field(const char *filename, FLAC__StreamMetadata *block, const die("out of memory allocating tag value"); data[size] = '\0'; if(0 == (f = fopen(field->field_value, "rb")) || fread(data, 1, size, f) != (size_t)size) { + fprintf(stderr, "%s: ERROR: while reading file '%s' for '%s' tag value: %s\n", filename, field->field_value, field->field_name, strerror(errno)); free(data); if(f) fclose(f); - fprintf(stderr, "%s: ERROR: while reading file '%s' for '%s' tag value\n", filename, field->field_value, field->field_name); return false; } fclose(f); @@ -291,7 +296,7 @@ FLAC__bool import_vc_from(const char *filename, FLAC__StreamMetadata *block, con f = fopen(vc_filename->value, "r"); if(0 == f) { - fprintf(stderr, "%s: ERROR: can't open import file %s\n", filename, vc_filename->value); + fprintf(stderr, "%s: ERROR: can't open import file %s: %s\n", filename, vc_filename->value, strerror(errno)); return false; } @@ -348,7 +353,7 @@ FLAC__bool export_vc_to(const char *filename, FLAC__StreamMetadata *block, const f = fopen(vc_filename->value, "w"); if(0 == f) { - fprintf(stderr, "%s: ERROR: can't open export file %s\n", filename, vc_filename->value); + fprintf(stderr, "%s: ERROR: can't open export file %s: %s\n", filename, vc_filename->value, strerror(errno)); return false; } diff --git a/src/metaflac/options.c b/src/metaflac/options.c index 7e947427..8deeaad8 100644 --- a/src/metaflac/options.c +++ b/src/metaflac/options.c @@ -16,6 +16,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#if HAVE_CONFIG_H +# include <config.h> +#endif + #include "options.h" #include "usage.h" #include "utils.h" diff --git a/src/metaflac/usage.c b/src/metaflac/usage.c index 4ba9f588..2ee9a4d3 100644 --- a/src/metaflac/usage.c +++ b/src/metaflac/usage.c @@ -16,6 +16,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#if HAVE_CONFIG_H +# include <config.h> +#endif + #include "usage.h" #include "FLAC/format.h" #include <stdarg.h> diff --git a/src/metaflac/utils.c b/src/metaflac/utils.c index 6dd88f83..75991d64 100644 --- a/src/metaflac/utils.c +++ b/src/metaflac/utils.c @@ -16,6 +16,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#if HAVE_CONFIG_H +# include <config.h> +#endif + #include "utils.h" #include "FLAC/assert.h" #include "share/utf8.h" |