X-Recipient: archive-cygwin@delorie.com X-Spam-Check-By: sourceware.org Date: Wed, 26 May 2010 16:34:28 +0200 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Reading /proc/registry/... returns extra char Message-ID: <20100526143428.GN10652@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20100513181249.GE13784@cupro.opengvs.com> <2BF01EB27B56CC478AD6E5A0A28931F2F01D44@A1DAL1SWPES19MB.ams.acs-inc.net> <20100526114733.GG10652@calimero.vinschen.de> <1254830174.20100526174227@mtu-net.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1254830174.20100526174227@mtu-net.ru> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Delivered-To: mailing list cygwin@cygwin.com On May 26 17:42, Andrey Repin wrote: > Greetings, Corinna Vinschen! > > >> > $ cat >a.dat > >> > /proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Syst > >> > emBootDevice > > > This trailing NUL character was always there, already with Cygwin 1.5. > > It's part of the file content. If strings are stored with a trailing > > NUL in a file, you don't want Cygwin to remove it for you, right? > > Wrong. The training NULL is a string value terminator for REG_SZ variables, > also a string separator for REG_MULTI_SZ ones. (Which ends with a spare NULL) > It must not be exposed to the user. I disagree. When you're using tools like regtool, you're right. But when accessing the registry as *files* via the virtual /proc filesystem, you want the file content. And the file contains the trailing NUL in REG_SZ and REG_EXPAND_SZ values, and multiple NULs in REG_MULTI_SZ values. What do you suppose Cygwin should do with the NULs in REG_MULTI_SZ values? Just remove them? > BTW, get it as a bugreport - reading REG_MULTI_SZ from /proc/registry returns > only first string. Yep, that's a bug. I'll look into it. Thanks for the report, Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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