From 3dd5fb78b19517ec3eb9ae40731b13b1705face3 Mon Sep 17 00:00:00 2001 From: leitner Date: Thu, 5 Feb 2004 01:29:18 +0000 Subject: [PATCH] cosmetics --- Makefile | 4 ++-- ldif_parse.c | 17 ++++++++++++----- tinyldap.c | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 035ed34..c5e3882 100644 --- a/Makefile +++ b/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 \ diff --git a/ldif_parse.c b/ldif_parse.c index 007fb60..d7d90cc 100644 --- a/ldif_parse.c +++ b/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; } } diff --git a/tinyldap.c b/tinyldap.c index d086bcc..f2c3425 100644 --- a/tinyldap.c +++ b/tinyldap.c @@ -16,6 +16,7 @@ #include "ip6.h" #include #endif +#include "case.h" #include #ifdef DEBUG