X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=2.0 required=5.0 tests=AWL,BAYES_00,CHARSET_FARAWAY_HEADER,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org MIME-Version: 1.0 X-Received: by 10.180.105.67 with SMTP id gk3mr1610216wib.31.1361948098986; Tue, 26 Feb 2013 22:54:58 -0800 (PST) Date: Wed, 27 Feb 2013 10:54:58 +0400 Message-ID: Subject: GetEnvironmentVariable doesn't work From: =?KOI8-R?B?4czFy9PFyiDwwdfMz9c=?= To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Hi! I set some environment variable. When I try to get it with GetEnvironmentVariable{A,W} it return empty result. With "getenv" I can get variable value. Also I think GetEnvironmentVariable doesn't work inside Cygwin.dll (maybe I wrong). My example code is: #include #include int main() { char* res = getenv("MYVARIABLE"); if (res) { printf("MYVARIABLE (via getenv) is %s\n",res); } char gev_res[256] = {'\0'}; GetEnvironmentVariableA("MYVARIABLE",gev_res,256); printf("MYVARIABLE (via GetEnvironmentVariableA) is %s\n",gev_res); return 0; } Is it a bug of Cygwin feature that I can't use GetEnvironmentVariable? Thanks, Alexey! -- 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