From 0780975703887f4fb21cfaa0c5869cb49daea482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Mon, 20 Nov 2017 11:31:18 +0000 Subject: make-dissectors: Another attempt to use newlines instead of spaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7ff5a0ea3eb3f7f56debc54aee6d5147815acc1b Reviewed-on: https://code.wireshark.org/review/24552 Petri-Dish: João Valverde Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde --- epan/dissectors/CMakeLists.txt | 2 +- epan/dissectors/Makefile.am | 2 +- epan/dissectors/make-dissectors.c | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/epan/dissectors/CMakeLists.txt b/epan/dissectors/CMakeLists.txt index 6ef31ee216..ba7656f253 100644 --- a/epan/dissectors/CMakeLists.txt +++ b/epan/dissectors/CMakeLists.txt @@ -1869,7 +1869,7 @@ target_link_libraries(make-dissectors ${GLIB2_LIBRARIES}) # file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/dissectors.c.in" - CONTENT "$" + CONTENT "$\n" ) add_custom_command( OUTPUT dissectors.c diff --git a/epan/dissectors/Makefile.am b/epan/dissectors/Makefile.am index f7d72c7b96..c6dbdb8fad 100644 --- a/epan/dissectors/Makefile.am +++ b/epan/dissectors/Makefile.am @@ -1942,7 +1942,7 @@ x11-dissector: $(top_srcdir)/tools/process-x11-fields.pl $(srcdir)/x11-fields $( # dissectors.c: make-dissectors $(ALL_DISSECTORS_SRC) @echo Making dissectors.c - @echo $(filter %.c,$^) > $@.in && \ + @echo $(filter %.c,$^) | tr ' ' '\n' > $@.in && \ $(builddir)/make-dissectors $@ @$@.in MOSTLYCLEANFILES = \ diff --git a/epan/dissectors/make-dissectors.c b/epan/dissectors/make-dissectors.c index f659cb7ed7..ffc35a4366 100644 --- a/epan/dissectors/make-dissectors.c +++ b/epan/dissectors/make-dissectors.c @@ -17,6 +17,12 @@ #define ARRAY_RESERVED_SIZE 2048 +#ifdef _WIN32 + #define SEP "\r\n" +#else + #define SEP "\n" +#endif + GRegex *protos_regex, *handoffs_regex; static int @@ -59,7 +65,7 @@ scan_list(const char *list, GPtrArray *protos, GPtrArray *handoffs) if (!g_file_get_contents(list, &contents, NULL, NULL)) return; - for (arg = strtok(contents, " \n"); arg != NULL; arg = strtok(NULL, " \n")) { + for (arg = strtok(contents, SEP); arg != NULL; arg = strtok(NULL, SEP)) { scan_file(arg, protos, handoffs); } g_free(contents); -- cgit v1.2.3