Dev+GNU Pascal [Was Re: Installation

Prof Abimbola Olowofoyeku African_Chief at bigfoot.com
Thu Sep 19 12:43:25 CEST 2002


On 19 Sep 2002 at 11:23, Maurice Lombardi wrote:

> Prof Abimbola Olowofoyeku a écrit:
[...]
> > Correct. The problem is with front slashes (or so it seems).
>
> This is probably not the problem

It is the problem. See below.

> I have tried the same four checks with front slashes after the -B
> (no front slashes possibles in the call c:\mingw\bin\gpc, command.com
> will not find the program)

This is precisely the problem. Whatever you pass to gpc, the gpc driver
internally changes back slashes to front slashes when it wants to spawn
its subprocesses (in the first instance, gpcpp). This is then treated
as an invalid command by command.com, and the gpc driver dies with a
complaint that it cannot find gpcpp (actually, it just cannot execute
it). This problem only exists under Win9x.

So the solution seems to be not to change the back slashes to front
slashes when running under Mingw - which is unfortunate, because Win
NT/2000/XP do not mind the front slashes.

The attached diff seems to solve the problem. I can release a patched
version of gpc.exe if it is deemed that the patch is appropriate for
inclusion in GPC (I hope also that the C code is correct!).

Best regards, The Chief
--------
Prof. Abimbola A. Olowofoyeku (The African Chief)
web:  http://www.bigfoot.com/~African_Chief
email: African_Chief at bigfoot.com


-------------- next part --------------
*** gpc.c.original	Thu May 09 18:43:54 2002
--- gpc.c	Thu Sep 19 11:11:20 2002
*************** find_a_file (pprefix, name, mode)
*** 2239,2244 ****
--- 2239,2245 ----
       int mode;
  {
    char *temp;
+   int i;
    const char *file_suffix = ((mode & X_OK) != 0 ? EXECUTABLE_SUFFIX : "");
    struct prefix_list *pl;
    int len = pprefix->max_len + strlen (name) + strlen (file_suffix) + 1;
*************** find_a_file (pprefix, name, mode)
*** 2294,2299 ****
--- 2295,2303 ----
                  strcat (temp, machine_suffix);
                  strcat (temp, name);
                  strcat (temp, file_suffix);
+ 		#if defined(GPC) && defined(__MINGW32__)  /* problems with front slashes under Win9x */
+  		for (i = 0; i <= strlen (temp); i++) if (temp[i] == '/') temp[i] = '\\';
+ 		#endif /* GPC && __MINGW32__ */
                  if (access (temp, mode) == 0)
                    {
                      if (pl->used_flag_ptr != 0)
*************** find_a_file (pprefix, name, mode)
*** 2306,2311 ****
--- 2310,2318 ----
              strcpy (temp, pl->prefix);
              strcat (temp, machine_suffix);
              strcat (temp, name);
+ 	    #if defined(GPC) && defined(__MINGW32__)  /* problems with front slashes under Win9x */
+  	    for (i = 0; i <= strlen (temp); i++) if (temp[i] == '/') temp[i] = '\\';
+ 	    #endif /* GPC && __MINGW32__ */
              if (access (temp, mode) == 0)
                {
                  if (pl->used_flag_ptr != 0)
*************** find_a_file (pprefix, name, mode)
*** 2326,2331 ****
--- 2333,2341 ----
                  strcat (temp, just_machine_suffix);
                  strcat (temp, name);
                  strcat (temp, file_suffix);
+ 		#if defined(GPC) && defined(__MINGW32__)  /* problems with front slashes under Win9x */
+  		for (i = 0; i <= strlen (temp); i++) if (temp[i] == '/') temp[i] = '\\';
+ 		#endif /* GPC && __MINGW32__ */
                  if (access (temp, mode) == 0)
                    {
                      if (pl->used_flag_ptr != 0)
*************** find_a_file (pprefix, name, mode)
*** 2337,2342 ****
--- 2347,2355 ----
              strcpy (temp, pl->prefix);
              strcat (temp, just_machine_suffix);
              strcat (temp, name);
+ 	    #if defined(GPC) && defined(__MINGW32__)  /* problems with front slashes under Win9x */
+  	    for (i = 0; i <= strlen (temp); i++) if (temp[i] == '/') temp[i] = '\\';
+ 	    #endif /* GPC && __MINGW32__ */
              if (access (temp, mode) == 0)
                {
                  if (pl->used_flag_ptr != 0)
*************** find_a_file (pprefix, name, mode)
*** 2356,2361 ****
--- 2369,2377 ----
                  strcpy (temp, pl->prefix);
                  strcat (temp, name);
                  strcat (temp, file_suffix);
+ 		#if defined(GPC) && defined(__MINGW32__)  /* problems with front slashes under Win9x */
+  		for (i = 0; i <= strlen (temp); i++) if (temp[i] == '/') temp[i] = '\\';
+ 		#endif /* GPC && __MINGW32__ */
                  if (access (temp, mode) == 0)
                    {
                      if (pl->used_flag_ptr != 0)
*************** find_a_file (pprefix, name, mode)
*** 2366,2371 ****
--- 2382,2390 ----
  
              strcpy (temp, pl->prefix);
              strcat (temp, name);
+   	    #if defined(GPC) && defined(__MINGW32__)  /* problems with front slashes under Win9x */
+  	    for (i = 0; i <= strlen (temp); i++) if (temp[i] == '/') temp[i] = '\\';
+ 	    #endif /* GPC && __MINGW32__ */
              if (access (temp, mode) == 0)
                {
                  if (pl->used_flag_ptr != 0)


More information about the Gpc mailing list