From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85052 invoked by alias); 6 Jun 2018 13:02:36 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 84947 invoked by uid 89); 6 Jun 2018 13:02:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=blake, Blake, HTo:D*cornell.edu, HTo:U*kbrown X-HELO: mail-wm0-f45.google.com Received: from mail-wm0-f45.google.com (HELO mail-wm0-f45.google.com) (74.125.82.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 06 Jun 2018 13:02:32 +0000 Received: by mail-wm0-f45.google.com with SMTP id o13-v6so11316923wmf.4 for ; Wed, 06 Jun 2018 06:02:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=945CStMmYycJlL7Wc9OOFItkYVgCV5RrIdLqXhm/Q2c=; b=gXzO3FhZ2LNjEQk1ILwYUPeTCxblK6fKIDpDQk63/fHVyBU2pzjIFlSN0bpE2gzF2x cAruX71jfos9Xw/0WgCxh1dOSVKaKpO4QSZ/sUVX9r/mW2r4tJS1zUN4FHJB9WVNfwWr tGm52P+USQ7v94Z/jPaYXRyks7GnvqajgmpenruPV811bPp5nzjYD4Mm4K26oT3UrFBd Nu5Luajsi8pE792DLc2dCHrv6WWea+8I8IPPx5S1OtKDJin1wfAa54eVbq/8+HA2pTGM RGIyRF+dYvgXsZXe3QHQRsvlztfpNVfZK/q/RunWk4XHwh2V2ZYVWl/4TFbqxhtCtzbq SfyA== X-Gm-Message-State: APt69E1ReID7PCCzhdFODUbWzC/39onoIHs19zvUs0V4VqNspFEIB7O8 6w0fdEUEtQEvXPNN0sySbWaYXmRx4ryRf3wmC/I= X-Google-Smtp-Source: ADUXVKJJK4lf/F8ONXxM7Cu/ghAjtPb4K2h9q1Mihx3e34VPMjN5oGdDxl0p0iycIwd2d37oB4+k82LjYDwK5d5Fze8= X-Received: by 2002:a1c:992:: with SMTP id 140-v6mr1804335wmj.86.1528290150108; Wed, 06 Jun 2018 06:02:30 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1c:d8c3:0:0:0:0:0 with HTTP; Wed, 6 Jun 2018 06:02:29 -0700 (PDT) In-Reply-To: References: <7df53a72-cf45-a5df-45dd-6ea2b7d8e0ed@redhat.com> From: Sam Habiel Date: Wed, 06 Jun 2018 13:02:00 -0000 Message-ID: Subject: Re: Help with C clearenv and setenv To: Ken Brown Cc: cygwin@cygwin.com, Eric Blake Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-06/txt/msg00059.txt.bz2 Eliot Moss, This worked perfectly: char *dummy = NULL; environ = &dummy; Thank you so much. --Sam On Mon, Jun 4, 2018 at 4:22 PM, Sam Habiel wrote: > Thank you! > > On Mon, Jun 4, 2018 at 3:39 PM, Ken Brown wrote: >> On 5/31/2018 9:43 AM, Eric Blake wrote: >>> >>> On 05/30/2018 09:48 AM, Sam Habiel wrote: >>>> >>>> I have code for a database I am porting to Cygwin. >>>> >>>> Part of that code is a clearenv() then a couple of setenvs. There is >>>> an ifdef for Cygwin, as it doesn't implement clearenv. >>> >>> >>> It wouldn't be hard to implement clearenv() for a future release of >>> Cygwin, at least for a version that leaves environ pointing to a 1-element >>> array containing NULL. A bit more effort and we could probably also support >>> glibc's notion of environ==NULL being shorthand for an empty environment; >> >> >> I've attempted to do this: >> >> https://cygwin.com/ml/cygwin-patches/2018-q2/msg00024.html >> >> Ken -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple