cosmetics
This commit is contained in:
4
Makefile
4
Makefile
@@ -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 \
|
||||
|
||||
17
ldif_parse.c
17
ldif_parse.c
@@ -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=∈
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "ip6.h"
|
||||
#include <wait.h>
|
||||
#endif
|
||||
#include "case.h"
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
Reference in New Issue
Block a user