X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=index%2Fdirs.c;h=b51704ba8b1bea0c1dc8f3f48f1f341f559ed496;hp=674fb913a3da73e31526a241c915ae57cb1233f2;hb=e4c6861efeeea654bfb00c5f0239ee258629d77f;hpb=ac13dceecd5f75669820819575daf88e0add5c8d diff --git a/index/dirs.c b/index/dirs.c index 674fb91..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-2011 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 @@ -62,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); @@ -120,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++; }