From 166932a47f271663d2134c3b9fd5cf82ed619286 Mon Sep 17 00:00:00 2001 From: johnvg Date: Mon, 18 Mar 2013 13:33:39 +0000 Subject: add hierarchical modules git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@2204 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d --- backendC/CleanCompilerSources/unix_io.c | 97 ++++++++++++++++++++++++++++----- 1 file changed, 83 insertions(+), 14 deletions(-) (limited to 'backendC') diff --git a/backendC/CleanCompilerSources/unix_io.c b/backendC/CleanCompilerSources/unix_io.c index 8849dbf..0a34ecf 100644 --- a/backendC/CleanCompilerSources/unix_io.c +++ b/backendC/CleanCompilerSources/unix_io.c @@ -57,6 +57,65 @@ static Bool file_exists (char *path) extern char *path_parameter; +static void append_file_name_and_ext (char *path_p,char *fname_p,char *ext,int in_clean_system_files_folder) +{ + int i; + char c; + + if (in_clean_system_files_folder){ + int last_dot_i; + + last_dot_i = -1; + + i=0; + while (c=fname_p[i], c!='\0'){ + if (c=='.') + last_dot_i=i; + ++i; + } + + if (last_dot_i>=0){ + i=0; + while (i #include #include @@ -257,9 +325,10 @@ File FOpen (char *wname, FileKind kind, char *mode) } strcat (after_last_slash,"/"); - strcat (after_last_slash,wname); + + strcat (after_last_slash,skip_after_last_dot (wname)); } else - strcpy (after_last_slash,wname); + strcpy (after_last_slash,skip_after_last_dot (wname)); strcat (after_last_slash,GetFileExtension (kind)); return fopen (path,mode); -- cgit v1.2.3