summaryrefslogtreecommitdiffstats
path: root/src/phcfg.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2020-06-02 17:33:50 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2020-06-02 17:33:50 +0200
commitb660bb8c035f1dbc5e01007e14917faa6b7a9d82 (patch)
tree29b272e3d89aa56a07ecab069bb3da1b2f554230 /src/phcfg.c
parent98ea5cddfeaeb28484c949f73e43f353ffdc0c08 (diff)
Lots of frama-c work that should be safe to commit
Diffstat (limited to 'src/phcfg.c')
-rw-r--r--src/phcfg.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/src/phcfg.c b/src/phcfg.c
index ef5a266..f5f4853 100644
--- a/src/phcfg.c
+++ b/src/phcfg.c
@@ -81,23 +81,11 @@ static FILE *file_options_save_aux(void)
}
}
#endif
-#ifndef DJGPP
+#if !defined(DJGPP) && !defined(__FRAMAC__)
if(filename==NULL)
{
char *home;
home = getenv("HOME");
-#if 0
- /* Using 'getpwuid' in statically linked applications requires at
- runtime the shared libraries from the glibc version used for linking
- */
- if (home == NULL)
- {
- struct passwd *pw;
- pw = getpwuid(getuid());
- if (pw != NULL)
- home = pw->pw_dir;
- }
-#endif
if (home != NULL)
{
filename=(char*)MALLOC(strlen(home)+strlen(DOT_PHOTOREC_CFG)+1);
@@ -157,22 +145,10 @@ static FILE *file_options_load_aux(void)
}
}
#endif
-#ifndef DJGPP
+#if !defined(DJGPP) && !defined(__FRAMAC__)
{
char *home;
home = getenv("HOME");
-#if 0
- /* Using 'getpwuid' in statically linked applications requires at
- runtime the shared libraries from the glibc version used for linking
- */
- if (home == NULL)
- {
- struct passwd *pw;
- pw = getpwuid(getuid());
- if (pw != NULL)
- home = pw->pw_dir;
- }
-#endif
if (home != NULL)
{
FILE*handle;
@@ -232,6 +208,9 @@ int file_options_load(file_enable_t *files_enable)
{
const char *extension=&buffer[0];
char *extension_status;
+#ifdef __FRAMAC__
+ Frama_C_make_unknown(buffer, sizeof(buffer)-1);
+#endif
buffer[sizeof(buffer)-1]='\0';
extension_status=strchr(buffer,',');
if(extension_status!=NULL)