Peter Marschall wrote:

Hi,

On Wednesday, 11. January 2006 10:10, Gergely Sánta wrote:
Chris Ridd wrote:
On 11/1/06 8:21, Gergely Sánta <[EMAIL PROTECTED]> wrote:
--Quanah Gibson-Mount wrote:
--On Tuesday, January 10, 2006 5:29 PM +0100 Gergely Sánta

<[EMAIL PROTECTED]> wrote:
Hi!

It seems, the problem is in my perl-experience.. I generated an
another,
bigger bug with my change, the trailing '\n'-s of lines  wasn't
removed..
So those lines wasn't equivalent at all :(

I'm attaching a diff of my changes, which now works fine for me..
Generally the standard is to use "diff -u" not just "diff", as the
default output is pretty useless to use to apply as a patch.

--Quanah
Ok, sorry, I didn't know.. Here is the "diff -u" with another little
change. After some googling on $INPUT_RECORD_SEPARATOR ($/), I found
that the difference between '$/ = undef' and '$/ = ""' is, that the
second one will treat two or more consecutive empty lines as a single
empty line. For this reason I added an additional line '$ln =~
s/\n\n+/\n\n/sg;'.

Maybe this isn't the best solution for accepting memory-files too, but
it works fine. I hope, it is not generating another bug to code.. Now
this works for buffers too:
What happens if your string contains lines terminated by "\r\n"
(DOS-style) or just "\r" (Classic MacOS-style) instead of just "\n"
(Unix-style)? I'm not sure if LDIF allows the Classic MacOS-style, but
I'm sure it allows the other two.

I'm too lazy too look ;-) and since you've got the code in your editor...

:-))

Cheers,

Chris
Yep, I had on mind that too, but I also killed too much time for this
problem :( This caused me a 2-day lag in my work, so I have no time for
experimenting with specific cases, sorry. I only know, that this solves my
problem (running on Linux and Solaris), and hope, it will help to others
with same needs too. Added a "\r" removing line, which will allow DOS-style
LDIFs. It seems to me, it not allows MacOS-style, but maybe I'm wrong.

There have been extensive changes to Nt::LDAP::LDIF which are currently
in SVN.
According to the output of the test program they should solve your problem.

To obtain the file simply grab it from:
http://svn.mutatus.co.uk/wsvn/perl-ldap/trunk/lib/Net/LDAP/LDIF.pm?op=file&rev=0&sc=0

Regards
Peter
It's working, thanks for the reply!

Gergely

Reply via email to