make-dissectors: Another attempt to use newlines instead of spaces
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>
Mon, 20 Nov 2017 11:31:18 +0000 (11:31 +0000)
committerJoão Valverde <j@v6e.pt>
Thu, 23 Nov 2017 16:59:52 +0000 (16:59 +0000)
Change-Id: I7ff5a0ea3eb3f7f56debc54aee6d5147815acc1b
Reviewed-on: https://code.wireshark.org/review/24552
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
epan/dissectors/CMakeLists.txt
epan/dissectors/Makefile.am
epan/dissectors/make-dissectors.c

index 6ef31ee21672373acd8e2c4a30e92718192225c3..ba7656f2531e621f9cbdb70381e068b54719e513 100644 (file)
@@ -1869,7 +1869,7 @@ target_link_libraries(make-dissectors ${GLIB2_LIBRARIES})
 #
 file(GENERATE
        OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/dissectors.c.in"
-       CONTENT "$<JOIN:${ALL_DISSECTOR_SRC}, >"
+       CONTENT "$<JOIN:${ALL_DISSECTOR_SRC},\n>\n"
 )
 add_custom_command(
        OUTPUT dissectors.c
index f7d72c7b966057d9cc22c5034049e5436786209d..c6dbdb8fadc09b36197b880013e05314e1bd1a2b 100644 (file)
@@ -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 = \
index f659cb7ed7777548bead7b47fd04829f700be456..ffc35a4366ba7c1158df8d06a9d8bfa5c8568f4c 100644 (file)
 
 #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);