Skip to content

Commit

Permalink
- fix the real Windows related bug and undo the last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jconway committed Oct 10, 2010
1 parent 020c324 commit 0f41dca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions pg_userfuncs.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@


extern MemoryContext plr_SPI_context; extern MemoryContext plr_SPI_context;


#if !defined(WIN32) && !defined(WIN64) #ifndef WIN32
extern char **environ; extern char **environ;
#endif #endif


Expand Down Expand Up @@ -284,7 +284,7 @@ plr_environ(PG_FUNCTION_ARGS)
char *var_name; char *var_name;
char *var_val; char *var_val;
char *values[2]; char *values[2];
#if !defined(WIN32) && !defined(WIN64) #ifndef WIN32
char **current_env; char **current_env;
#else #else
char *buf; char *buf;
Expand Down Expand Up @@ -326,7 +326,7 @@ plr_environ(PG_FUNCTION_ARGS)
/* initialize our tuplestore */ /* initialize our tuplestore */
tupstore = TUPLESTORE_BEGIN_HEAP; tupstore = TUPLESTORE_BEGIN_HEAP;


#if !defined(WIN32) && !defined(WIN64) #ifndef WIN32
for (current_env = environ; for (current_env = environ;
current_env != NULL && *current_env != NULL; current_env != NULL && *current_env != NULL;
current_env++) current_env++)
Expand Down Expand Up @@ -361,6 +361,8 @@ plr_environ(PG_FUNCTION_ARGS)
envstr++; envstr++;
count++; count++;
} }
/* reset pointer to the environment buffer */
envstr = buf;


while(*buf == '=') while(*buf == '=')
buf++; buf++;
Expand Down Expand Up @@ -388,7 +390,7 @@ plr_environ(PG_FUNCTION_ARGS)
buf++; buf++;
} }


FreeEnvironmentStrings(buf); FreeEnvironmentStrings(envstr);
#endif #endif


/* /*
Expand Down
2 changes: 1 addition & 1 deletion plr.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ plr_init(void)
/* arrange for automatic cleanup at proc_exit */ /* arrange for automatic cleanup at proc_exit */
on_proc_exit(plr_cleanup, 0); on_proc_exit(plr_cleanup, 0);


#if !defined(WIN32) && !defined(WIN64) #ifndef WIN32
/* /*
* Force non-interactive mode since R may not do so. * Force non-interactive mode since R may not do so.
* See comment in Rembedded.c just after R_Interactive = TRUE: * See comment in Rembedded.c just after R_Interactive = TRUE:
Expand Down

0 comments on commit 0f41dca

Please sign in to comment.