[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1625-g59660b5

[email protected] (Chris Liddell)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  59660b5d998b53df383192aee71b7439a424be47 (commit)
       via  94742723659fb4bba6b50ad29123d4ff38a9ebd6 (commit)
       via  4135d3b50a66dc67eb7f4f4ad360fdf703783141 (commit)
       via  2b9ab0d54ab2299b3db94e57f45cfc52f6045e62 (commit)
      from  cc2cbb8c78acdff736a966eb40ca22a6a7c52b26 (commit)

----------------------------------------------------------------------
commit 59660b5d998b53df383192aee71b7439a424be47
Author: Chris Liddell <[email protected]>
Date:   Thu Aug 29 10:02:49 2019 +0100

    Fix clearing of the drag and drop file list
    
    Because we have to store the list of file names from drag and drop events, in
    order to correctly add and remove them from the permit file read list, we also
    want to clear the lists before we destroy the "text" window object.
    
    The problem is, this happens after we shutdown Ghostscript and unload the dll.
    
    This moves that clearing of the list into function that we call before we
    shut down.

diff --git a/psi/dwmain.c b/psi/dwmain.c
index ebddbb5..de9f61c 100644
--- a/psi/dwmain.c
+++ b/psi/dwmain.c
@@ -383,7 +383,7 @@ int new_main(int argc, char *argv[])
         text_puts(tw, "*** C stack overflow. Quiting...\n");
     }
 #endif
-
+    text_clear_drag_and_drop_list(tw, 1);
     gsdll.delete_instance(instance);
 
     unload_dll(&gsdll);
diff --git a/psi/dwtext.c b/psi/dwtext.c
index 984ea45..f236b5b 100644
--- a/psi/dwtext.c
+++ b/psi/dwtext.c
@@ -736,8 +736,26 @@ int ch;
     return (dest-line);
 }
 
+void
+text_clear_drag_and_drop_list(TW* tw, int freelist)
+{
+    int i;
+    for (i = 0; tw->szFiles && i < tw->cFiles; i++) {
+        if (tw->szFiles[i] != NULL) {
+            dwmain_remove_file_control_path(tw->szFiles[i]);
+            free(tw->szFiles[i]);
+            tw->szFiles[i] = NULL;
+        }
+    }
+    if (freelist != 0) {
+        free(tw->szFiles);
+        tw->szFiles = NULL;
+        tw->cFiles = 0;
+    }
+}
+
 /* Windows 3.1 drag-drop feature */
-void
+static void
 text_drag_drop(TW *tw, HDROP hdrop)
 {
     int i, cFiles, code;
@@ -746,15 +764,7 @@ text_drag_drop(TW *tw, HDROP hdrop)
     const TCHAR *t;
     if ( (tw->DragPre==NULL) || (tw->DragPost==NULL) )
             return;
-
-    for (i = 0; tw->szFiles && i < tw->cFiles; i++) {
-        if (tw->szFiles[i] != NULL) {
-            dwmain_remove_file_control_path(tw->szFiles[i]);
-            free(tw->szFiles[i]);
-            tw->szFiles[i] = NULL;
-        }
-    }
-
+    text_clear_drag_and_drop_list(tw, 0);
     cFiles = DragQueryFile(hdrop, (UINT)(-1), (LPTSTR)NULL, 0);
     if (tw->cFiles < cFiles) {
         free(tw->szFiles);
@@ -1178,17 +1188,6 @@ WndTextProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
             if (tw->hfont)
                 DeleteFont(tw->hfont);
             tw->hfont = (HFONT)0;
-            {/* Remove left over drag'n'drop file names */
-                int i;
-                for (i = 0; tw->szFiles != NULL && i < tw->cFiles; i++) {
-                    dwmain_remove_file_control_path(tw->szFiles[i]);
-                    free(tw->szFiles[i]);
-                    tw->szFiles[i] = NULL;
-                }
-                free(tw->szFiles);
-                tw->szFiles = NULL;
-                tw->cFiles = 0;
-            }
             tw->quitnow = TRUE;
             PostQuitMessage(0);
             break;
diff --git a/psi/dwtext.h b/psi/dwtext.h
index 4a02d5c..f6bd6cc 100644
--- a/psi/dwtext.h
+++ b/psi/dwtext.h
@@ -144,6 +144,10 @@ int text_getpos(TW *tw, int *px, int *py, int *pcx, int *pcy);
  */
 void text_drag(TW *tw, const char *pre_drag, const char *post_drag);
 
+/* Clear the list of files/paths from the drag and drop stuff */
+void
+text_clear_drag_and_drop_list(TW* tw, int freelist);
+
 /* provide access to window handle */
 HWND text_get_handle(TW *tw);
 

----------------------------------------------------------------------
commit 94742723659fb4bba6b50ad29123d4ff38a9ebd6
Author: Chris Liddell <[email protected]>
Date:   Wed Aug 28 10:14:52 2019 +0100

    Fix path permissions added from cidfmap.
    
    From the cidfmap, we accumulate a list of unique directory paths a we process
    cidfmap and then add them - when I did that code, I forgot that to allow access
    to the directory, we need a trailing directory separator.
    
    Add that before calling .addcontrolpath

diff --git a/Resource/Init/gs_cidfm.ps b/Resource/Init/gs_cidfm.ps
index 5ec3d5d..5eb25f0 100644
--- a/Resource/Init/gs_cidfm.ps
+++ b/Resource/Init/gs_cidfm.ps
@@ -209,7 +209,7 @@ currentdict end def
     } loop
   } forall
   currentdict end
-  {exch pop /PermitFileReading exch .addcontrolpath} forall
+  {exch pop (/) concatstrings /PermitFileReading exch .addcontrolpath} forall
 
   % Checks for vicious substitution cycles.
   dup length dict copy                  % <<map>>

----------------------------------------------------------------------
commit 4135d3b50a66dc67eb7f4f4ad360fdf703783141
Author: Chris Liddell <[email protected]>
Date:   Tue Aug 27 16:49:30 2019 +0100

    Fix font file finding with -P
    
    In trying to reproduce the issue that inspired commit dea69cd04964, I noticed
    that font file searching wasn't working correctly with -P specified on the
    command line.
    
    Previously, it could just end up with us not finding a font we should have, but
    with dea69cd04964 it would result in a typecheck error.
    
    This ensures the stack is always how it should be after the findlibfile
    call

diff --git a/Resource/Init/gs_fonts.ps b/Resource/Init/gs_fonts.ps
index f5e938b..8e36155 100644
--- a/Resource/Init/gs_fonts.ps
+++ b/Resource/Init/gs_fonts.ps
@@ -1043,6 +1043,7 @@ $error /SubstituteFont { } put
           //true
         } ifelse
 
+
         % if findlibfile didn't work, try just opening the file direcly.
         {
           dup (r) { file } stopped {
@@ -1050,7 +1051,10 @@ $error /SubstituteFont { } put
           } {
             //false
           } ifelse
-        } if
+        }
+        {
+          //false
+        }ifelse
 
         {
           QUIET not

----------------------------------------------------------------------
commit 2b9ab0d54ab2299b3db94e57f45cfc52f6045e62
Author: Chris Liddell <[email protected]>
Date:   Thu Aug 22 16:10:03 2019 +0100

    Make it clear: file/path matching is always case sensitive
    
    even on Windows.

diff --git a/doc/Use.htm b/doc/Use.htm
index 6a2bf55..94f221d 100644
--- a/doc/Use.htm
+++ b/doc/Use.htm
@@ -3485,9 +3485,9 @@ operation of <code>setpagedevice</code>, and because this capability is <i>extre
 rarely used, we feel the improvement in security warrants the small reduction in
 flexibility.
 <p>
-Path matching is simple: we do not implement full featured &quot;globbing&quot; or
-regular expression matching (such complexity would significantly and negatively
-impact performance). The following cases are handled:
+Path matching is simple: it is case sensitive, and we do not implement full featured
+&quot;globbing&quot; or regular expression matching (such complexity would significantly
+and negatively impact performance). The following cases are handled:
 <ul>
 <li>
 <dt><code>&quot;&sol;path&sol;to&sol;file&quot;</code></dt>
@@ -3503,6 +3503,12 @@ impact performance). The following cases are handled:
 any child of that directory.
 </li>
 </ul>
+<p><strong>Important Note for Windows Users</strong>:
+<br>
+The file/path pattern matching is case sensitive, even on Windows. This is a
+change in behaviour compared to the old code which, on Windows, was case
+<i>in</i>sensitive. This is in recognition of changes in Windows behaviour,
+in that it now supports (although does not enforce) case sensitivity.
 <p>
 Four command line parameters permit explicit control of the paths included in
 the access control lists:


Summary of changes:
 Resource/Init/gs_cidfm.ps |  2 +-
 Resource/Init/gs_fonts.ps |  6 +++++-
 doc/Use.htm               | 12 +++++++++---
 psi/dwmain.c              |  2 +-
 psi/dwtext.c              | 39 +++++++++++++++++++--------------------
 psi/dwtext.h              |  4 ++++
 6 files changed, 39 insertions(+), 26 deletions(-)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.