X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=index%2Fdirs.c;h=b51704ba8b1bea0c1dc8f3f48f1f341f559ed496;hp=c5b5a59d3b4026a18e41155c25287252363a2885;hb=e4c6861efeeea654bfb00c5f0239ee258629d77f;hpb=a66b7d79383ae700f3358731eecfe2aafed0e90d diff --git a/index/dirs.c b/index/dirs.c index c5b5a59..b51704b 100644 --- a/index/dirs.c +++ b/index/dirs.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 1994-2010 Index Data + Copyright (C) 2004-2013 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -18,6 +18,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_CONFIG_H +#include +#endif #include #include #include @@ -59,13 +62,13 @@ static int dirs_client_proc(char *name, const char *info, int pos, entry = ci->entries + ci->no_cur; if (info[0] == sizeof(entry->sysno)+sizeof(entry->mtime)) { - strcpy(entry->path, name + ci->prelen); + strcpy(entry->path, name + ci->prelen); entry->kind = dirs_file; memcpy(&entry->sysno, info+1, sizeof(entry->sysno)); - memcpy(&entry->mtime, info+1+sizeof(entry->sysno), + memcpy(&entry->mtime, info+1+sizeof(entry->sysno), sizeof(entry->mtime)); ci->no_cur++; - } + } else if (info[0] == sizeof(entry->mtime)) { strcpy(entry->path, name + ci->prelen); @@ -117,10 +120,10 @@ struct dirs_info *dirs_fopen(Dict dict, const char *path, int rw) info = dict_lookup(dict, path); if (info && info[0] == sizeof(entry->sysno)+sizeof(entry->mtime)) { - strcpy(entry->path, path); + strcpy(entry->path, path); entry->kind = dirs_file; memcpy(&entry->sysno, info+1, sizeof(entry->sysno)); - memcpy(&entry->mtime, info+1+sizeof(entry->sysno), + memcpy(&entry->mtime, info+1+sizeof(entry->sysno), sizeof(entry->mtime)); p->no_cur++; }