Skip to content

Commit

Permalink
Use winargs.c also for unix (step 1 in refactoring out the various ar…
Browse files Browse the repository at this point in the history
…gs-files)
  • Loading branch information
thoni56 committed Aug 9, 2019
1 parent 7f83b25 commit 19b99b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions interpreter/args.c
Expand Up @@ -166,20 +166,16 @@ bool differentInterpreterName(char *string) {


/*======================================================================*/
#if defined(__windows__) || defined(__cygwin__)
#if defined(__windows__) || defined(__cygwin__) || defined(__unix__)
#include "winargs.c"
#else
#if defined(__unix__) || defined(__macos__)
#if defined(__macos__)
#include "unixargs.c"
#else
#ifdef __mac__
#include "macargs.c"
#else
/***********************************************************************\
UNIMPLEMENTED OS
\***********************************************************************/
#endif
#endif
#endif
6 changes: 3 additions & 3 deletions interpreter/winargs.c
Expand Up @@ -63,9 +63,9 @@ void args(int argc, char * argv[])
if (differentInterpreterName(programName)) {
// TODO break out as a function
FILE *adventureFile;
adventureFileName = duplicate(programName,
strlen(programName)
+strlen(ACODEEXTENSION)+1);
adventureFileName = allocate(strlen(programName)
+strlen(ACODEEXTENSION)+1);
strcpy(adventureFileName, programName);
strcat(adventureFileName, ACODEEXTENSION);
// TODO break out as utils::fileExists()
if ((adventureFile = fopen(adventureFileName, "r")) == NULL) {
Expand Down

0 comments on commit 19b99b8

Please sign in to comment.