From mboxrd@z Thu Jan 1 00:00:00 1970 From: H. Peter Anvin Date: Mon, 13 Aug 2007 09:35:15 -0700 Subject: [Cluster-devel] Re: [PATCH] gfs2: better code for translating characters In-Reply-To: <91b13c310708130219j170190f6r100c47171f92077@mail.gmail.com> References: <11869741183677-git-send-email-crquan@gmail.com> <91b13c310708122008w27b86359n5b135df3e229e616@mail.gmail.com> <46BFDDBB.2020104@zytor.com> <91b13c310708122206v5e4023f2w7464611a96ae67d9@mail.gmail.com> <46BFF179.8060308@zytor.com> <91b13c310708130219j170190f6r100c47171f92077@mail.gmail.com> Message-ID: <46C08843.8010302@zytor.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit rae l wrote: > On 8/13/07, H. Peter Anvin wrote: >> You seem to have confused modern compiled C with an old BASIC interpreter. >> >> Consider the code in point: >> >> - while ((table = strchr(sdp->sd_table_name, '/'))) >> + table = sdp->sd_table_name; >> + while ((table = strchr(table, '/'))) >> *table = '_'; > Sorry, I just mean for call to strchr, things are different, > especially for multiple '/' chars appeared. Things are different only for multiple '/' chars. In that case, the latter form is better, in the former case, there is no difference. So it doesn't matter. One is unambiguously better. -hpa