0d77e7a6ad0e — Duncan Ross Palmer 2 years ago
Merged branch f/201804-compiler-warnings at revision 9698aed20a1f into develop

Changesets merged:

  Branch f/201804-compiler-warnings
  * 2555ea909eb5: Fix some compiler warnings [DRP]
  * 87b86e4c07d7: Resolve "maybe uninitialized" header [DRP]
  * 9698aed20a1f: Remove apparently unfinished code because of unused
    variable "outputIsDir" [DRP]
1 files changed, 2 insertions(+), 11 deletions(-)

M raw2c.c
M raw2c.c +2 -11
@@ 84,6 84,8 @@ int main (int argc, char* argv[]) {
 
 	struct FileOrDir input, output, header;
 
+	header.handle.file = NULL;
+
 	if (parse(argc, argv)) {
 		syntax();
 		return EXIT_FAILURE;

          
@@ 189,7 191,6 @@ static int openFiles(
 	struct FileOrDir *pHeader
 ) {
 
-	int outputIsDir;
 	struct stat fileInfo;
 
 	/* Find out if the input is a directory */

          
@@ 202,16 203,6 @@ static int openFiles(
 	/* Find out if the file is "too large" and warn user */
 	fileSizeWarning(options.inputFileName, fileInfo.st_size);
 
-	/*
-	 * Find out if the output is a directory, if it's a file, we'll overwrite it,
-         * no matter how many inputs; if it's a directory, we need to populate it
-	 * instead, with the structure as the input.
-	 */
-	if (0 == stat(options.outputFileName, &fileInfo)) {
-		outputIsDir = S_ISDIR(fileInfo.st_mode);
-	} else {
-		outputIsDir = 0;
-	}
 	initFileOrDir(pOutput, S_ISDIR(fileInfo.st_mode));
 
 	/* Open the files or directories */