MICROTAR: Patch microtar to allow reading from files we are writing to.

This commit is contained in:
Patrick Niklaus 2018-03-22 11:24:41 +00:00
parent ee447afd72
commit e25654c210

View File

@ -187,7 +187,7 @@ int mtar_open(mtar_t *tar, const char *filename, const char *mode) {
/* Assure mode is always binary */
if ( strchr(mode, 'r') ) mode = "rb";
if ( strchr(mode, 'w') ) mode = "wb";
if ( strchr(mode, 'w') ) mode = "w+b";
if ( strchr(mode, 'a') ) mode = "ab";
/* Open file */
tar->stream = fopen(filename, mode);