[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Documentation: unclear comment
From: |
Micah Cowan |
Subject: |
Re: Documentation: unclear comment |
Date: |
Thu, 09 Dec 2010 17:00:09 -0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Thunderbird/3.0.10 |
(12/09/2010 04:48 AM), Christophe Jarry wrote:
> Dear developers,
>
> I read
> http://www.gnu.org/software/sed/manual/html_node/Rename-files-to-lower-case.html#Rename-files-to-lower-case
> today and found the following comment unclear:
>
> # if it is, do not print nothing
That is not the comment. Both lines together are a full sentence, a
single comment.
> inside:
>
> # check if converted file name is equal to original file name,
> # if it is, do not print nothing
> /^.*\/\(.*\)\n\1/b
>
> I think this comment means "do not print anything".
> Please correct the documentation accordingly.
Why would that be what the comment means? It's not what the code does.
Check what the comment for the code line just above says: "[the line]
now contains path/file-name\nconverted-file-name [after this]".
/^.*\/\(.*\)\n\1/b
will branch to the beginning of the script (skipping printing) if, for
example, the line buffer has:
/foo/bar/baz
baz
IOW, if the original file was already lowercase. So the comment
accurately describes what the code does.
If anything should be changed here, perhaps the parenthetical remark
"(in other words, the basename is already lowercase)" could be added.
--
HTH,
Micah J. Cowan
http://micah.cowan.name/