X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Wed, 26 May 2010 16:34:28 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Reading /proc/registry/... returns extra char Message-ID: <20100526143428.GN10652@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20100513181249 DOT GE13784 AT cupro DOT opengvs DOT com> <2BF01EB27B56CC478AD6E5A0A28931F2F01D44 AT A1DAL1SWPES19MB DOT ams DOT acs-inc DOT net> <20100526114733 DOT GG10652 AT calimero DOT vinschen DOT de> <1254830174 DOT 20100526174227 AT mtu-net DOT 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 AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 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