Commit 6667d3d8 authored by Jonas Smedegaard's avatar Jonas Smedegaard

New upstream version 9.25~dfsg

parent 7a8eb7a3
......@@ -70,7 +70,7 @@
% Save a copy of the initial gstate.
//systemdict /savedinitialgstate gstate readonly .forceput
.setglobal
} .bind def
} .bind executeonly def % must be bound and hidden for .forceput
% Initialize local dictionaries and gstate when creating a new context.
% Note that until this completes, we are in the anomalous situation of
......
......@@ -408,7 +408,7 @@ currentdict end def
exit
} loop
exch setglobal
} bind def
} .bind executeonly def % must be bound and hidden for .forceput
currentdict end /ProcSet defineresource pop
......
This diff is collapsed.
......@@ -163,7 +163,8 @@ end
% Set them again to the new values. From here on, we are safe,
% since a context switch will consult userparams.
.setuserparams
} .bind def
} .bind executeonly def % must be bound and hidden for .forceput
/setuserparams { % <dict> setuserparams -
.setuserparams2
} .bind odef
......@@ -1072,10 +1073,10 @@ def
% the values given into an array. This is consistent with what we see when
% testing with Adobe Distiller 6.0.
% <cyan> <magenta> <yellow> <black> <key> findcmykcustomcolor <array>
/findcmykcustomcolor { 5 array astore } bind def
/findcmykcustomcolor { 5 array astore } bind executeonly def
% The following isn't documented by Adobe, but was found in Adobe Illustrator (R)
% Version 7.0 Full Prolog
/findrgbcustomcolor { 4 array astore } bind def
/findrgbcustomcolor { 4 array astore } bind executeonly def
% Build a tint transform function for use by setcustomcolor. This function
% is for a Separation color space which has either a DeviceCMYK base color space
......@@ -1104,7 +1105,7 @@ def
]
} ifelse
cvx bind exch pop % Make executable and remove the input array
} bind def
} bind executeonly def
% Construct the colorspace array to be used by setcolorspace from the array
% result of either findcmykcustomcolor or findrgbcustomcolor.
......@@ -1124,7 +1125,7 @@ def
]
} ifelse
exch pop % remove the input array
} bind def
} bind executeonly def
% Set a custom color based upon a tint and array which describes the custom
% color. See findcmykcustomcolor. First we create and then set a Separation
......@@ -1133,14 +1134,51 @@ def
% for some reason, so an alternate operational mode is tolerated:
% null setcustomcolor -
/setcustomcolor % <array> <tint> setcustomcolor -
{ dup //null ne {
{
dup //null eq {
pop pop
}{
% Check that the tint is a number between 0 and 1
dup type dup /integertype eq exch /realtype eq or not {
/setcustomcolor /typecheck cvx signalerror
} if
dup 1 le not {
/setcustomcolor /rangecheck cvx signalerror
} if
dup 0 ge not {
/setcustomcolor /rangecheck cvx signalerror
} if
% The array is supposed to be the result of fundcmykcustomcolor. Our
% implementation just pushes all the arguments into the array and that's
% what buildcolorspacearray expects. So check that now.
% Starting with the first N-1 elemenst which must be numbers where 0 <= x <= 1
1 index
0 1 2 index length 2 sub
{
1 index exch get dup
type dup /integertype eq exch /realtype eq or not {
/setcustomcolor /typecheck cvx signalerror
} if
dup
1 le not {
/setcustomcolor /rangecheck cvx signalerror
} if
0 ge not {
/setcustomcolor /rangecheck cvx signalerror
} if
} for
% Finally, check the last element of the array, which must be a string.
dup length 1 sub get type /stringtype eq not {
/setcustomcolor /typecheck cvx signalerror
} if
exch //buildcolorspacearray exec
setcolorspace % Set the Separation color space as current
setcolor % Set the tint as the current color
}
{ pop pop } % 'null' as the tint is ignored. pop tint and array
ifelse
} bind def
} ifelse
} bind executeonly def
% This proc is supposed to implement a version of overprinting. TN 5044 says
% that this proc is not used by any shipping host-based application. We have
......
......@@ -660,8 +660,7 @@ currentdict /.pdfmarkparams .undef
{
pop
} ifelse
}
bind def
} .bind executeonly def % must be bound and hidden for .forceput
% Use the DSC processing hook to pass DSC comments to the driver.
% We use a pseudo-parameter named DSC whose value is an array:
......
......@@ -95,27 +95,41 @@ level2dict begin
{ % Since setpagedevice doesn't create new device objects,
% we must (carefully) reinstall the old parameters in
% the same device.
.currentpagedevice pop //null currentdevice //null .trysetparams
.currentpagedevice pop //null currentdevice //null
{ .trysetparams } .internalstopped
{
//null
} if
dup type /booleantype eq
{ pop pop }
{ % This should never happen!
{
SETPDDEBUG { (Error in .trysetparams!) = pstack flush } if
cleartomark pop pop pop
{cleartomark pop pop pop} .internalstopped pop
% if resetting the entire device state failed, at least put back the
% security related key
currentdevice //null //false mark /.LockSafetyParams
currentpagedevice /.LockSafetyParams .knownget not
{systemdict /SAFER .knownget not {//false} } if
.putdeviceparamsonly
/.installpagedevice cvx /rangecheck signalerror
}
ifelse pop pop
% A careful reading of the Red Book reveals that an erasepage
% should occur, but *not* an initgraphics.
erasepage .beginpage
} bind def
} bind executeonly def
/.uninstallpagedevice
{ 2 .endpage { .currentnumcopies //false .outputpage } if
{
{2 .endpage { .currentnumcopies //false .outputpage } if} .internalstopped pop
nulldevice
} bind def
(%grestorepagedevice) cvn
{ .uninstallpagedevice grestore .installpagedevice
{
.uninstallpagedevice
grestore
.installpagedevice
} bind def
(%grestoreallpagedevice) cvn
......@@ -624,7 +638,7 @@ SETPDDEBUG { (Rolling back.) = pstack flush } if
{ 4 index 3 1 roll .forceput }
{ 3 index exch .undef }
ifelse
} .bind
} .bind executeonly % must be bound and hidden for .forceput
7 { % For PageSize only, just impose the request.
1 index /PageSize eq
{ pop pop 1 index /PageSize 7 put }
......
......@@ -85,7 +85,7 @@ systemdict /.removeglyphs .undef
{ dup /FontType 32 .forceput
dup /CharStrings 20 dict .forceput
1 index exch .buildfont32 exch pop
} bind def
} .bind executeonly def % must be bound and hidden for .forceput
end % .cidfonttypes
......
......@@ -166,6 +166,16 @@ pdfdict begin
% using .pdfpagelabels and not using pdfmarks
/WantsPageLabels /GetDeviceParam .special_op
{pop pop false}{true} ifelse
%% This is truly ugly.....
%% GSView 5 redefines pdfmark and processes it itself. However if it gets
%% a pdfmark it cannot cope with, it simply fails. Its not prepared to cope
%% with PAGELABEL pdfmarks, so we don't want to send it to them. There's no
%% way for us to fix GSView 5, its long out of any kind of support, but we do
%% try not to break it. We happen to know that GSView 5 installs a GSview
%% dictionary in userdict, so this test simply ensures we don't emit PAGELABEL
%% pdfmarks if that dictioanry is present.
userdict /GSview known {pop false} if
} bind executeonly
% generate pagelabel pdfmark
/dopagelabel { % -- dopagelabel --
......
......@@ -131,9 +131,6 @@ currentdict /gput_always_allow .undef
%% original TextSaveMatrix behind allows the matching ET not to throw an error, as well as coping
%% with the various other problems listed above. Its not pretty though.
currentdict /TextSaveMatrix known {
( **** Error: Encountered a 'q' inside a Text Object, this is illegal.\n)
pdfformaterror
( Output may be incorrect..\n) pdfformaterror
currentdict /TextSaveMatrix get matrix copy
gsave //nodict begin
/qTextSaveMatrix gput
......
......@@ -1331,7 +1331,7 @@ int gx_device_subclass(gx_device *dev_to_subclass, gx_device *new_prototype, uns
{
gx_device *child_dev;
void *psubclass_data;
gs_memory_struct_type_t *a_std, *b_std;
gs_memory_struct_type_t *a_std, *b_std = NULL;
int dynamic = dev_to_subclass->stype_is_dynamic;
char *ptr, *ptr1;
......
......@@ -5072,6 +5072,9 @@ pdf14_mark_fill_rectangle_ko_simple(gx_device * dev, int x, int y, int w, int h,
int shift = 8;
byte shape = 0; /* Quiet compiler. */
byte src_alpha;
bool overprint = pdev->overprint;
gx_color_index drawn_comps = pdev->drawn_comps;
gx_color_index comps;
if (buf->data == NULL)
return 0;
......@@ -5165,8 +5168,16 @@ pdf14_mark_fill_rectangle_ko_simple(gx_device * dev, int x, int y, int w, int h,
for (k = 0; k < num_chan; ++k)
dst_ptr[k * planestride] = dst[k];
} else {
for (k = 0; k < num_comp; ++k)
dst_ptr[k * planestride] = 255 - dst[k];
if (overprint) {
for (k = 0, comps = drawn_comps; comps != 0; ++k, comps >>= 1) {
if ((comps & 0x1) != 0) {
dst_ptr[k * planestride] = 255 - dst[k];
}
}
} else {
for (k = 0; k < num_comp; ++k)
dst_ptr[k * planestride] = 255 - dst[k];
}
dst_ptr[num_comp * planestride] = dst[num_comp];
}
if (tag_off) {
......
......@@ -250,9 +250,6 @@ gp_printfile(const char *filename, const char *pmport)
/* WinNT stores default printer in registry and win.ini */
/* Win95 stores default printer in win.ini */
#ifdef GS_NO_UTF8
GetProfileString("windows", "device", "", buf, sizeof(buf));
#else
wchar_t wbuf[512];
int l;
......@@ -261,7 +258,6 @@ gp_printfile(const char *filename, const char *pmport)
if (l < 0 || l > sizeof(buf))
return_error(gs_error_undefinedfilename);
wchar_to_utf8(buf, wbuf);
#endif
if ((p = strchr(buf, ',')) != NULL)
*p = '\0';
return gp_printfile_win32(filename, buf);
......@@ -368,9 +364,6 @@ BOOL gp_OpenPrinter(char *port, LPHANDLE printer)
{
#ifdef METRO
return FALSE;
#else
#ifdef GS_NO_UTF8
return OpenPrinter(port, printer, NULL);
#else
BOOL opened;
wchar_t *uni = malloc(utf8_to_wchar(NULL, port) * sizeof(wchar_t));
......@@ -380,7 +373,6 @@ BOOL gp_OpenPrinter(char *port, LPHANDLE printer)
free(uni);
return opened;
#endif
#endif
}
#ifndef METRO
......@@ -468,11 +460,7 @@ gp_printfile_win32(const char *filename, char *port)
FILE *mswin_popen(const char *cmd, const char *mode)
{
SECURITY_ATTRIBUTES saAttr;
#ifdef GS_NO_UTF8
STARTUPINFO siStartInfo;
#else
STARTUPINFOW siStartInfo;
#endif
PROCESS_INFORMATION piProcInfo;
HANDLE hPipeTemp = INVALID_HANDLE_VALUE;
HANDLE hChildStdinRd = INVALID_HANDLE_VALUE;
......@@ -481,11 +469,7 @@ FILE *mswin_popen(const char *cmd, const char *mode)
HANDLE hChildStderrWr = INVALID_HANDLE_VALUE;
HANDLE hProcess = GetCurrentProcess();
int handle = 0;
#ifdef GS_NO_UTF8
char *command = NULL;
#else
wchar_t *command = NULL;
#endif
FILE *pipe = NULL;
if (strcmp(mode, "wb") != 0)
......@@ -531,25 +515,15 @@ FILE *mswin_popen(const char *cmd, const char *mode)
siStartInfo.hStdError = hChildStderrWr;
if (handle == 0) {
#ifdef GS_NO_UTF8
command = (char *)malloc(strlen(cmd)+1);
if (command)
strcpy(command, cmd);
#else
command = (wchar_t *)malloc(sizeof(wchar_t)*utf8_to_wchar(NULL, cmd));
if (command)
utf8_to_wchar(command, cmd);
#endif
else
handle = -1;
}
if (handle == 0)
#ifdef GS_NO_UTF8
if (!CreateProcess(NULL,
#else
if (!CreateProcessW(NULL,
#endif
command, /* command line */
NULL, /* process security attributes */
NULL, /* primary thread security attributes */
......@@ -608,31 +582,26 @@ gp_open_scratch_file_generic(const gs_memory_t *mem,
FILE *f = NULL;
char sTempDir[_MAX_PATH];
char sTempFileName[_MAX_PATH];
#if defined(METRO) || !defined(GS_NO_UTF8)
wchar_t wTempDir[_MAX_PATH];
wchar_t wTempFileName[_MAX_PATH];
wchar_t wPrefix[_MAX_PATH];
#endif
memset(fname, 0, gp_file_name_sizeof);
if (!gp_file_name_is_absolute(prefix, strlen(prefix))) {
int plen = _MAX_PATH;
/* gp_gettmpdir will always return a UTF8 encoded string unless
* GS_NO_UTF8 is defined, due to the windows specific version of
* gp_getenv being called (in gp_wgetv.c, not gp_getnv.c) */
/* gp_gettmpdir will always return a UTF8 encoded string
* due to the windows specific version of gp_getenv
* being called (in gp_wgetv.c, not gp_getnv.c) */
if (gp_gettmpdir(sTempDir, &plen) != 0) {
#ifdef METRO
/* METRO always uses UTF8 for 'ascii' - there is no concept of
* local encoding, so GS_NO_UTF8 makes no difference here. */
* local encoding. */
l = GetTempPathWRT(_MAX_PATH, wTempDir);
l = wchar_to_utf8(sTempDir, wTempDir);
#elif defined(GS_NO_UTF8)
l = GetTempPathA(_MAX_PATH, sTempDir);
#else
GetTempPathW(_MAX_PATH, wTempDir);
l = wchar_to_utf8(sTempDir, wTempDir);
#endif
l = wchar_to_utf8(sTempDir, wTempDir);
} else
l = strlen(sTempDir);
} else {
......@@ -645,19 +614,14 @@ gp_open_scratch_file_generic(const gs_memory_t *mem,
sTempDir[l-1] = '\\'; /* What Windoze prefers */
if (l <= _MAX_PATH) {
#ifdef METRO
utf8_to_wchar(wTempDir, sTempDir);
utf8_to_wchar(wPrefix, prefix);
#ifdef METRO
n = GetTempFileNameWRT(wTempDir, wPrefix, wTempFileName);
n = wchar_to_utf8(sTempFileName, wTempFileName);
#elif defined(GS_NO_UTF8)
n = GetTempFileNameA(sTempDir, prefix, 0, sTempFileName);
#else
utf8_to_wchar(wTempDir, sTempDir);
utf8_to_wchar(wPrefix, prefix);
GetTempFileNameW(wTempDir, wPrefix, 0, wTempFileName);
n = wchar_to_utf8(sTempFileName, wTempFileName);
#endif
n = wchar_to_utf8(sTempFileName, wTempFileName);
if (n == 0) {
/* If 'prefix' is not a directory, it is a path prefix. */
int l = strlen(sTempDir), i;
......@@ -672,28 +636,16 @@ gp_open_scratch_file_generic(const gs_memory_t *mem,
}
}
if (i > 0) {
#ifdef METRO
utf8_to_wchar(wPrefix, sTempDir + i);
#ifdef METRO
GetTempFileNameWRT(wTempDir, wPrefix, wTempFileName);
n = wchar_to_utf8(sTempFileName, wTempFileName);
#elif defined(GS_NO_UTF8)
n = GetTempFileNameA(sTempDir, sTempDir + i, 0, sTempFileName);
#else
utf8_to_wchar(wPrefix, sTempDir + i);
GetTempFileNameW(wTempDir, wPrefix, 0, wTempFileName);
n = wchar_to_utf8(sTempFileName, wTempFileName);
#endif
n = wchar_to_utf8(sTempFileName, wTempFileName);
}
}
if (n != 0) {
#ifdef GS_NO_UTF8
hfile = CreateFile(sTempFileName,
GENERIC_READ | GENERIC_WRITE | DELETE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL | (remove ? FILE_FLAG_DELETE_ON_CLOSE : 0),
NULL);
#else
int len = utf8_to_wchar(NULL, sTempFileName);
wchar_t *uni = (len > 0 ? malloc(sizeof(wchar_t)*len) : NULL);
if (uni == NULL)
......@@ -716,7 +668,6 @@ gp_open_scratch_file_generic(const gs_memory_t *mem,
#endif
free(uni);
}
#endif
}
}
if (hfile != INVALID_HANDLE_VALUE) {
......@@ -767,9 +718,6 @@ gp_open_scratch_file_rm(const gs_memory_t *mem,
FILE *
gp_fopen(const char *fname, const char *mode)
{
#ifdef GS_NO_UTF8
return fopen(fname, mode);
#else
int len = utf8_to_wchar(NULL, fname);
wchar_t *uni;
wchar_t wmode[4];
......@@ -785,14 +733,10 @@ gp_fopen(const char *fname, const char *mode)
file = _wfopen(uni, wmode);
free(uni);
return file;
#endif
}
int gp_stat(const char *path, struct _stat *buf)
{
#ifdef GS_NO_UTF8
return stat(path, buf);
#else
int len = utf8_to_wchar(NULL, path);
wchar_t *uni;
int ret;
......@@ -806,7 +750,6 @@ int gp_stat(const char *path, struct _stat *buf)
ret = _wstat(uni, buf);
free(uni);
return ret;
#endif
}
/* test whether gp_fdup is supported on this platform */
......
......@@ -84,11 +84,7 @@ const char gp_fmode_wb[] = "wb";
/* ------ File enumeration ------ */
struct directory_enum_s {
#ifdef GS_NO_UTF8
WIN32_FIND_DATA find_data;
#else
WIN32_FIND_DATAW find_data;
#endif
HANDLE find_handle;
char *pattern; /* orig pattern + modified pattern */
int patlen; /* orig pattern length */
......@@ -235,11 +231,7 @@ gp_enumerate_files_next(file_enum * pfen, char *ptr, uint maxlen)
directory_enum *new_denum = NULL, *pden = pfen->current;
int code = 0;
uint len;
#ifdef GS_NO_UTF8
char *outfname;
#else
char outfname[(sizeof(pden->find_data.cFileName)*3+1)/2];
#endif
if (pfen->illegal) {
gp_enumerate_files_close(pfen);
return ~(uint) 0;
......@@ -247,9 +239,6 @@ gp_enumerate_files_next(file_enum * pfen, char *ptr, uint maxlen)
for(;;) {
if (pden->first_time) {
#ifdef GS_NO_UTF8
pden->find_handle = FindFirstFile(pden->pattern, &(pden->find_data));
#else
wchar_t *pat;
pat = malloc(utf8_to_wchar(NULL, pden->pattern)*sizeof(wchar_t));
if (pat == NULL) {
......@@ -263,7 +252,6 @@ gp_enumerate_files_next(file_enum * pfen, char *ptr, uint maxlen)
pden->find_handle = FindFirstFileW(pat, &(pden->find_data));
#endif
free(pat);
#endif
if (pden->find_handle == INVALID_HANDLE_VALUE) {
if (pden->previous) {
FindClose(pden->find_handle);
......@@ -281,11 +269,7 @@ gp_enumerate_files_next(file_enum * pfen, char *ptr, uint maxlen)
}
pden->first_time = 0;
} else {
#ifdef GS_NO_UTF8
if (!FindNextFile(pden->find_handle, &(pden->find_data))) {
#else
if (!FindNextFileW(pden->find_handle, &(pden->find_data))) {
#endif
if (pden->previous) {
FindClose(pden->find_handle);
gs_free_object(pden->memory, pden->pattern,
......@@ -301,26 +285,6 @@ gp_enumerate_files_next(file_enum * pfen, char *ptr, uint maxlen)
}
}
}
#ifdef GS_NO_UTF8
if ( strcmp(".", pden->find_data.cFileName)
&& strcmp("..", pden->find_data.cFileName)) {
if (pden->find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY){
new_denum = gs_alloc_struct(pden->memory, directory_enum, &st_directory_enum, "gp_enumerate_files");
if (new_denum != 0) {
if (enumerate_directory_init(pden->memory, new_denum, pden->pattern, pden->head_size,
pden->find_data.cFileName, &pden->pattern[pden->head_size], pden->pat_size - pden->head_size) < 0)
{
gs_free_object(pden->memory, new_denum, "free directory enumerator on error");
}
new_denum->previous = pden;
pden = new_denum;
pfen->current = pden;
}
}
else
break;
}
#else
if ( wcscmp(L".", pden->find_data.cFileName)
&& wcscmp(L"..", pden->find_data.cFileName)) {
if (pden->find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
......@@ -347,18 +311,13 @@ gp_enumerate_files_next(file_enum * pfen, char *ptr, uint maxlen)
else
break;
}
#endif
}
if (code != 0) { /* All done, clean up. */
gp_enumerate_files_close(pfen);
return ~(uint) 0;
}
#ifdef GS_NO_UTF8
outfname = pden->find_data.cFileName;
#else
wchar_to_utf8(outfname, pden->find_data.cFileName);
#endif
len = strlen(outfname);
if (pden->head_size + len < maxlen) {
......
/* Copyright (C) 2001-2018 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
CA 94945, U.S.A., +1(415)492-9861, for further information.
*/
/* System V Unix-specific routines for Ghostscript */
/* This file contains a couple of standard Unix library procedures */
/* that a few System V platforms don't provide. */
/* Note that this file is NOT used for SVR4 platforms. */
#include <errno.h>
#include "stdio_.h"
#include "time_.h"
#include <sys/types.h>
#include <sys/times.h>
#include <sys/stat.h>
#include <sys/param.h>
/* rename */
int
rename(const char *a, const char *b)
{
if (access(a, 0) == -1)
return (-1);
unlink(b);
if (link(a, b) == -1)
return (-1);
if (unlink(a) == -1) {
unlink(b); /* ??? */
return (-1);
}
return (0);
}
/* gettimeofday */
#ifndef HZ
# define HZ 100 /* see sys/param.h */
#endif
int
gettimeofday(struct timeval *tvp, struct timezone *tzp)
{
struct tms tms;
static long offset = 0;
long ticks;
if (!offset) {
time(&offset);
offset -= (times(&tms) / HZ);
}
ticks = times(&tms);
tvp->tv_sec = ticks / HZ + offset;
tvp->tv_usec = (ticks % HZ) * (1000 * 1000 / HZ);
return 0;
}
......@@ -16,16 +16,8 @@
/* MS Windows implementation of gp_getenv, and gp_serialnumber */
#ifdef GS_NO_UTF8 /* We want the real sprintf, so unhide it */
#define sprintf
#endif
#include "windows_.h"
#ifdef GS_NO_UTF8
#undef sprintf
#endif
#include <stdio.h>
#include <stdlib.h> /* for getenv */
#include <string.h>
......@@ -37,37 +29,6 @@
* Key = hkeyroot\\key, named value = name.
* name, ptr, plen and return values are the same as in gp_getenv();
*/
#ifdef GS_NO_UTF8
static int
gp_getenv_registry(HKEY hkeyroot, const char *key, const char *name,
char *ptr, int *plen)
{
HKEY hkey;
DWORD cbData;
BYTE b;
LONG rc;
BYTE *bptr = (BYTE *)ptr;
if (RegOpenKeyEx(hkeyroot, key, 0, KEY_READ, &hkey)
== ERROR_SUCCESS) {
cbData = *plen;
if (bptr == (char *)NULL)
bptr = &b; /* Registry API won't return ERROR_MORE_DATA */
/* if ptr is NULL */
rc = RegQueryValueEx(hkey, (char *)name, 0, NULL, bptr, &cbData);
RegCloseKey(hkey);
if (rc == ERROR_SUCCESS) {
*plen = cbData;
return 0; /* found environment variable and copied it */
} else if (rc == ERROR_MORE_DATA) {
/* buffer wasn't large enough */
*plen = cbData;
return -1;
}
}
return 1; /* not found */
}
#else /* ifdef GS_NO_UTF8 */
int
gp_getenv_registry(HKEY hkeyroot, const wchar_t *key, const char *name,
char *ptr, int *plen)
......@@ -144,7 +105,6 @@ gp_getenv_registry(HKEY hkeyroot, const wchar_t *key, const char *name,
free(wname);
return 1; /* environment variable does not exist */
}
#endif /* ifdef GS_NO_UTF8 */
#endif /* ifdef __WIN32__ */
/* ------ Environment variables ------ */
......@@ -153,23 +113,6 @@ gp_getenv_registry(HKEY hkeyroot, const wchar_t *key, const char *name,
int
gp_getenv(const char *name, char *ptr, int *plen)
{
#ifdef GS_NO_UTF8
const char *str = getenv(name);
if (str) {
int len = strlen(str);
if (len < *plen) {
/* string fits */
strcpy(ptr, str);
*plen = len + 1;
return 0;
}