xorg-server-1.18-support-multiple-Files-sections.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. See http://lists.x.org/archives/xorg-devel/2015-February/045755.html
  2. diff --git a/hw/xfree86/parser/Files.c b/hw/xfree86/parser/Files.c
  3. index 849bf92..5cc3ec7 100644
  4. --- a/hw/xfree86/parser/Files.c
  5. +++ b/hw/xfree86/parser/Files.c
  6. @@ -76,14 +76,18 @@ static xf86ConfigSymTabRec FilesTab[] = {
  7. #define CLEANUP xf86freeFiles
  8. XF86ConfFilesPtr
  9. -xf86parseFilesSection(void)
  10. +xf86parseFilesSection(XF86ConfFilesPtr ptr)
  11. {
  12. int i, j;
  13. int k, l;
  14. char *str;
  15. int token;
  16. - parsePrologue(XF86ConfFilesPtr, XF86ConfFilesRec)
  17. + if (!ptr) {
  18. + if( (ptr=calloc(1,sizeof(XF86ConfFilesRec))) == NULL ) {
  19. + return NULL;
  20. + }
  21. + }
  22. while ((token = xf86getToken(FilesTab)) != ENDSECTION) {
  23. switch (token) {
  24. diff --git a/hw/xfree86/parser/configProcs.h b/hw/xfree86/parser/configProcs.h
  25. index 171f8e8..e8199fe 100644
  26. --- a/hw/xfree86/parser/configProcs.h
  27. +++ b/hw/xfree86/parser/configProcs.h
  28. @@ -36,7 +36,7 @@ void xf86freeDeviceList(XF86ConfDevicePtr ptr);
  29. int xf86validateDevice(XF86ConfigPtr p);
  30. /* Files.c */
  31. -XF86ConfFilesPtr xf86parseFilesSection(void);
  32. +XF86ConfFilesPtr xf86parseFilesSection(XF86ConfFilesPtr ptr);
  33. void xf86printFileSection(FILE * cf, XF86ConfFilesPtr ptr);
  34. void xf86freeFiles(XF86ConfFilesPtr p);
  35. diff --git a/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c
  36. index 327c02a..e0d6139 100644
  37. --- a/hw/xfree86/parser/read.c
  38. +++ b/hw/xfree86/parser/read.c
  39. @@ -110,7 +110,7 @@ xf86readConfigFile(void)
  40. if (xf86nameCompare(xf86_lex_val.str, "files") == 0) {
  41. free(xf86_lex_val.str);
  42. xf86_lex_val.str = NULL;
  43. - HANDLE_RETURN(conf_files, xf86parseFilesSection());
  44. + HANDLE_RETURN(conf_files, xf86parseFilesSection(ptr->conf_files));
  45. }
  46. else if (xf86nameCompare(xf86_lex_val.str, "serverflags") == 0) {
  47. free(xf86_lex_val.str);