From: Olivier Goffart Date: Wed, 7 Nov 2018 10:09:41 +0000 (+0100) Subject: Remove csync_misc: The code no longer use fnmatch X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~420 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f0c24cb6f9fdb5367dd29f4af0cd5ec5dcaba63c;p=nextcloud-desktop.git Remove csync_misc: The code no longer use fnmatch --- diff --git a/src/csync/CMakeLists.txt b/src/csync/CMakeLists.txt index 8d59f8d5a..eefa41339 100644 --- a/src/csync/CMakeLists.txt +++ b/src/csync/CMakeLists.txt @@ -32,7 +32,6 @@ endif() set(csync_SRCS csync_exclude.cpp csync_util.cpp - csync_misc.cpp std/c_alloc.c std/c_string.c diff --git a/src/csync/ConfigureChecks.cmake b/src/csync/ConfigureChecks.cmake index e035e2ebb..d6a028ce8 100644 --- a/src/csync/ConfigureChecks.cmake +++ b/src/csync/ConfigureChecks.cmake @@ -27,12 +27,6 @@ endif (NOT LINUX) check_function_exists(asprintf HAVE_ASPRINTF) -check_function_exists(fnmatch HAVE_FNMATCH) -if(NOT HAVE_FNMATCH AND WIN32) - find_library(SHLWAPI_LIBRARY shlwapi) - set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} shlwapi) -endif() - if(WIN32) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} psapi kernel32) endif() diff --git a/src/csync/config_csync.h.cmake b/src/csync/config_csync.h.cmake index 9a8043f1b..aff1bb744 100644 --- a/src/csync/config_csync.h.cmake +++ b/src/csync/config_csync.h.cmake @@ -12,7 +12,6 @@ #cmakedefine HAVE_STRERROR_R 1 #cmakedefine HAVE_UTIMES 1 #cmakedefine HAVE_LSTAT 1 -#cmakedefine HAVE_FNMATCH 1 #cmakedefine HAVE___MINGW_ASPRINTF 1 #cmakedefine HAVE_ASPRINTF 1 diff --git a/src/csync/csync_exclude.cpp b/src/csync/csync_exclude.cpp index c21b1e00c..3a752b069 100644 --- a/src/csync/csync_exclude.cpp +++ b/src/csync/csync_exclude.cpp @@ -29,7 +29,6 @@ #include "c_utf8.h" #include "csync_exclude.h" -#include "csync_misc.h" #include "common/utility.h" #include "../version.h" diff --git a/src/csync/csync_macros.h b/src/csync/csync_macros.h deleted file mode 100644 index 492bc6bfa..000000000 --- a/src/csync/csync_macros.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * cynapses libc functions - * - * Copyright (c) 2008-2013 by Andreas Schneider - * Copyright (c) 2012-2013 by Klaas Freitag - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef _CSYNC_MACROS_H -#define _CSYNC_MACROS_H - -#include -#include - -/* How many elements there are in a static array */ -#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) - -/* Some special custom errno values to report bugs properly. The BASE value - * should always be larger than the highest system errno. */ -#define CSYNC_CUSTOM_ERRNO_BASE 10000 - -#define ERRNO_WRONG_CONTENT (CSYNC_CUSTOM_ERRNO_BASE+11) -#define ERRNO_SERVICE_UNAVAILABLE (CSYNC_CUSTOM_ERRNO_BASE+14) -#define ERRNO_STORAGE_UNAVAILABLE (CSYNC_CUSTOM_ERRNO_BASE+17) -#define ERRNO_FORBIDDEN (CSYNC_CUSTOM_ERRNO_BASE+18) - -#endif /* _CSYNC_MACROS_H */ -/* vim: set ft=c.doxygen ts=8 sw=2 et cindent: */ diff --git a/src/csync/csync_misc.cpp b/src/csync/csync_misc.cpp deleted file mode 100644 index bd6f9a6d7..000000000 --- a/src/csync/csync_misc.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * libcsync -- a library to sync a directory with another - * - * Copyright (c) 2008-2013 by Andreas Schneider - * Copyright (c) 2012-2013 by Klaas Freitag - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "config_csync.h" - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - -#include -#include -#include -#include -#include -#include - -#if _WIN32 -# ifndef _WIN32_IE -# define _WIN32_IE 0x0501 // SHGetSpecialFolderPath -# endif -# include -#else /* _WIN32 */ -# include -#endif /* _WIN32 */ - -#include "c_lib.h" -#include "csync_misc.h" -#include "csync_macros.h" - -#ifdef HAVE_FNMATCH -#include - -int csync_fnmatch(__const char *__pattern, __const char *__name, int __flags) { - return fnmatch(__pattern, __name, __flags); -} - -#else /* HAVE_FNMATCH */ - -#include -int csync_fnmatch(const char *pattern, const char *name, int flags) { - BOOL match; - - (void) flags; - - match = PathMatchSpecA(name, pattern); - - if(match) - return 0; - else - return 1; -} -#endif /* HAVE_FNMATCH */ - diff --git a/src/csync/csync_misc.h b/src/csync/csync_misc.h deleted file mode 100644 index a68ff7849..000000000 --- a/src/csync/csync_misc.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * libcsync -- a library to sync a directory with another - * - * Copyright (c) 2008-2013 by Andreas Schneider - * Copyright (c) 2012-2013 by Klaas Freitag - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef _CSYNC_MISC_H -#define _CSYNC_MISC_H - -#include -#include - -#ifdef HAVE_FNMATCH -#include -#else -/* Steal this define to make csync_exclude compile. Note that if fnmatch - * is not defined it's probably Win32 which uses a different implementation - * than fmmatch anyway, which does not care for flags. - **/ -#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ -#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ -#endif - -int csync_fnmatch(const char *pattern, const char *name, int flags); - -#endif /* _CSYNC_MISC_H */