Commit 3e2ef668 authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

Put in a workaround for the problem with plug-ins on NT and W2K, where

1999-08-28  Tor Lillqvist  <tml@iki.fi>

* libgimp/gimp.c (gimp_main): Put in a workaround for the problem
with plug-ins on NT and W2K, where installing the GIMP under a
directory path with spaces (\Program Files\GIMP) would cause the
plug-ins to malfunction. Turns out the argv gets set up by the C
runtime incorrectly in such a case, the path name of the
executable is split at the spaces. The workaround is to splice
argv[0] together from the pieces again, shifting the rest of argv
down.

* app/plug_in.c (plug_in_open): Correct (harmless) typo in the
Win32 code.

* plug-ins/common/winclipboard.c: Put the pasting of a new image
under File/Acquire.
parent 34f76ba3
1999-08-28 Tor Lillqvist <tml@iki.fi>
* libgimp/gimp.c (gimp_main): Put in a workaround for the problem
with plug-ins on NT and W2K, where installing the GIMP under a
directory path with spaces (\Program Files\GIMP) would cause the
plug-ins to malfunction. Turns out the argv gets set up by the C
runtime incorrectly in such a case, the path name of the
executable is split at the spaces. The workaround is to splice
argv[0] together from the pieces again, shifting the rest of argv
down.
* app/plug_in.c (plug_in_open): Correct (harmless) typo in the
Win32 code.
* app/gimpbrushpipe.c (gimp_brush_pixmap_select_brush): In the
case of angular selection, offset angle with G_PI/2 to be
compatible with PSP tubes. Restrict the index of each dimension
......@@ -8,6 +20,9 @@
* plug-ins/common/gpb.c (gih_save_dialog): Must not free the combo
box string list, the strings are not strdup'ed by the combo box.
* plug-ins/common/winclipboard.c: Put the pasting of a new image
under File/Acquire.
Fri Aug 27 18:15:33 PDT 1999 Manish Singh <yosh@gimp.org>
* app/gdisplay_color.c: more work on the gamma correction stuff
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -860,7 +860,7 @@ plug_in_open (PlugIn *plug_in)
#else
sprintf (plug_in->args[2], "%d",
g_io_channel_win32_get_fd (plug_in->his_read));
sprintf (plug_in->args[3], "%d:%ud:%d",
sprintf (plug_in->args[3], "%d:%u:%d",
g_io_channel_win32_get_fd (plug_in->his_write),
GetCurrentThreadId (),
g_io_channel_win32_get_fd (plug_in->my_read));
......
......@@ -136,6 +136,41 @@ gimp_main (int argc,
#ifdef NATIVE_WIN32
char *peer, *peer_fd;
guint32 thread;
int i, j, k;
#endif
#ifdef NATIVE_WIN32
/* Check for exe file name with spaces in the path having been split up
* by buggy NT C runtime, or something. I don't know why this happens
* on NT (including w2k), but not on w95/98.
*/
for (i = 1; i < argc; i++)
{
k = strlen (argv[i]);
if (k > 10)
if (g_strcasecmp (argv[i] + k - 4, ".exe") == 0)
{
/* Found the end of the executable name, most probably.
* Splice the parts of the name back together.
*/
GString *s;
s = g_string_new (argv[0]);
for (j = 1; j <= i; j++)
{
s = g_string_append_c (s, ' ');
s = g_string_append (s, argv[j]);
}
argv[0] = s->str;
/* Move rest of argv down */
for (j = 1; j < argc - i; j++)
argv[j] = argv[j + i];
argv[argc - i] = NULL;
argc -= i;
break;
}
}
#endif
if ((argc < 4) || (strcmp (argv[1], "-gimp") != 0))
......
......@@ -120,12 +120,12 @@ query ()
copy_args, NULL);
gimp_install_procedure ("extension_clipboard_paste",
"paste image from clipboard",
"Paste image from clipboard, creates a new image.",
"Get image from clipboard",
"Get an image from the Windows clipboard, creating a new image",
"Hans Breuer",
"Hans Breuer",
"1999",
"<Toolbox>/Xtns/Paste from Clipboard",
"<Toolbox>/File/Acquire/From Clipboard",
"",
PROC_EXTENSION,
ncopy_args, 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment