From 9b5bda1ce12928243f82bd5dd3b9d45c527fad25 Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Sat, 14 Oct 2000 16:08:27 +0000 Subject: [PATCH] Minor tweaks to fix output path problems git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@921 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/SWIG1.1/main.cxx | 12 +++++++++++- Source/Swig/include.c | 3 +-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Source/SWIG1.1/main.cxx b/Source/SWIG1.1/main.cxx index 95dbea0b3..fba0e6df5 100644 --- a/Source/SWIG1.1/main.cxx +++ b/Source/SWIG1.1/main.cxx @@ -362,11 +362,21 @@ int SWIG_main(int argc, char *argv[], Language *l) { } if (!outfile_name) { + char *cc = infilename + strlen(infilename); + while (cc != infilename) { + if (*cc == '/') { + cc++; + break; + } + cc--; + } sprintf(fn_runtime,"%s_wrap.c",infilename); strcpy(infile,infilename); - strcpy(output_dir,""); + outfile_name = fn_runtime; } else { sprintf(fn_runtime,"%s",outfile_name); + } + { // Try to identify the output directory char *cc = outfile_name; char *lastc = outfile_name; diff --git a/Source/Swig/include.c b/Source/Swig/include.c index b182fdadb..12b662a1d 100644 --- a/Source/Swig/include.c +++ b/Source/Swig/include.c @@ -19,8 +19,7 @@ static char cvsroot[] = "$Header$"; static List *directories = 0; /* List of include directories */ static String *lastpath = 0; /* Last file that was included */ -static int bytes_read = 0; /* Bytes read */ - +static int bytes_read = 0; /* Bytes read */ static String *swiglib = 0; /* Location of SWIG library */ /* -----------------------------------------------------------------------------