cosmetics

This commit is contained in:
leitner
2004-02-05 01:29:18 +00:00
parent 2cb40c89c0
commit 3dd5fb78b1
3 changed files with 15 additions and 7 deletions

View File

@@ -1,8 +1,8 @@
DEBUG=1
#DEBUG=1
all: t1 t2 parse dumpidx idx2ldif addindex bindrequest tinyldap \
tinyldap_standalone tinyldap_debug ldapclient ldapclient_str \
md5password t6 # t
md5password # t6 # t
asn1.a: fmt_asn1intpayload.o fmt_asn1length.o fmt_asn1tag.o \
fmt_asn1int.o fmt_asn1string.o fmt_asn1transparent.o scan_asn1tag.o \

View File

@@ -202,14 +202,21 @@ int ldif_parse(const char* filename) {
char buf[4096];
int fd;
buffer in;
if (str_equal(filename,"-")) fd=0; else fd=open_read(filename);
if (fd<0) return 1;
buffer_init(&in,read,fd,buf,sizeof buf);
buffer* tmp;
if (filename[0]=='-' && !filename[1]) {
tmp=buffer_0;
fd=-1;
} else {
fd=open_read(filename);
if (fd<0) return 1;
buffer_init(&in,read,fd,buf,sizeof buf);
tmp=&in;
}
dn=mduptab_adds(&attributes,"dn");
objectClass=mduptab_adds(&attributes,"objectClass");
{
int res=parserec(&in,&first);
close(fd);
int res=parserec(tmp,&first);
if (fd!=-1) close(fd);
return res;
}
}

View File

@@ -16,6 +16,7 @@
#include "ip6.h"
#include <wait.h>
#endif
#include "case.h"
#include <signal.h>
#ifdef DEBUG