Changeset 3140 for trunk/src/kmk/amiga.c


Ignore:
Timestamp:
Mar 14, 2018, 10:28:10 PM (7 years ago)
Author:
bird
Message:

kmk: Merged in changes from GNU make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6 / https://git.savannah.gnu.org/git/make.git).

Location:
trunk/src/kmk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk

  • trunk/src/kmk/amiga.c

    r2591 r3140  
    11/* Running commands on Amiga
    2 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
    3 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
     2Copyright (C) 1995-2016 Free Software Foundation, Inc.
    43This file is part of GNU Make.
    54
     
    1615this program.  If not, see <http://www.gnu.org/licenses/>.  */
    1716
    18 #include "make.h"
     17#include "makeint.h"
    1918#include "variable.h"
    2019#include "amiga.h"
     
    2625
    2726static const char Amiga_version[] = "$VER: Make 3.74.3 (12.05.96) \n"
    28                     "Amiga Port by A. Digulla (digulla@home.lake.de)";
     27                    "Amiga Port by A. Digulla (digulla@home.lake.de)";
    2928
    3029int
     
    3837    for (aptr=argv; *aptr; aptr++)
    3938    {
    40         len += strlen (*aptr) + 4;
     39        len += strlen (*aptr) + 4;
    4140    }
    4241
     
    4443
    4544    if (!buffer)
    46       fatal (NILF, "MyExecute: Cannot allocate space for calling a command");
     45      O (fatal, NILF, "MyExecute: Cannot allocate space for calling a command\n");
    4746
    4847    ptr = buffer;
     
    5049    for (aptr=argv; *aptr; aptr++)
    5150    {
    52         if (((*aptr)[0] == ';' && !(*aptr)[1]))
    53         {
    54             *ptr ++ = '"';
    55             strcpy (ptr, *aptr);
    56             ptr += strlen (ptr);
    57             *ptr ++ = '"';
    58         }
    59         else if ((*aptr)[0] == '@' && (*aptr)[1] == '@' && !(*aptr)[2])
    60         {
    61             *ptr ++ = '\n';
    62             continue;
    63         }
    64         else
    65         {
    66             strcpy (ptr, *aptr);
    67             ptr += strlen (ptr);
    68         }
    69         *ptr ++ = ' ';
    70         *ptr = 0;
     51        if (((*aptr)[0] == ';' && !(*aptr)[1]))
     52        {
     53            *ptr ++ = '"';
     54            strcpy (ptr, *aptr);
     55            ptr += strlen (ptr);
     56            *ptr ++ = '"';
     57        }
     58        else if ((*aptr)[0] == '@' && (*aptr)[1] == '@' && !(*aptr)[2])
     59        {
     60            *ptr ++ = '\n';
     61            continue;
     62        }
     63        else
     64        {
     65            strcpy (ptr, *aptr);
     66            ptr += strlen (ptr);
     67        }
     68        *ptr ++ = ' ';
     69        *ptr = 0;
    7170    }
    7271
     
    7473
    7574    status = SystemTags (buffer,
    76         SYS_UserShell, TRUE,
    77         TAG_END);
     75        SYS_UserShell, TRUE,
     76        TAG_END);
    7877
    7978    FreeMem (buffer, len);
    8079
    81     if (SetSignal(0L,0L) & SIGBREAKF_CTRL_C)
    82         status = 20;
     80    if (SetSignal (0L,0L) & SIGBREAKF_CTRL_C)
     81        status = 20;
    8382
    8483    /* Warnings don't count */
    8584    if (status == 5)
    86         status = 0;
     85        status = 0;
    8786
    8887    return status;
     
    9291wildcard_expansion (char *wc, char *o)
    9392{
    94 #   define PATH_SIZE    1024
     93#   define PATH_SIZE    1024
    9594    struct AnchorPath * apath;
    9695
    9796    if ( (apath = AllocMem (sizeof (struct AnchorPath) + PATH_SIZE,
    98             MEMF_CLEAR))
    99         )
     97            MEMF_CLEAR))
     98        )
    10099    {
    101         apath->ap_Strlen = PATH_SIZE;
     100        apath->ap_Strlen = PATH_SIZE;
    102101
    103         if (MatchFirst (wc, apath) == 0)
    104         {
    105             do
    106             {
    107                 o = variable_buffer_output (o, apath->ap_Buf,
    108                         strlen (apath->ap_Buf));
    109                 o = variable_buffer_output (o, " ",1);
    110             } while (MatchNext (apath) == 0);
    111         }
     102        if (MatchFirst (wc, apath) == 0)
     103        {
     104            do
     105            {
     106                o = variable_buffer_output (o, apath->ap_Buf,
     107                        strlen (apath->ap_Buf));
     108                o = variable_buffer_output (o, " ",1);
     109            } while (MatchNext (apath) == 0);
     110        }
    112111
    113         MatchEnd (apath);
    114         FreeMem (apath, sizeof (struct AnchorPath) + PATH_SIZE);
     112        MatchEnd (apath);
     113        FreeMem (apath, sizeof (struct AnchorPath) + PATH_SIZE);
    115114    }
    116115
Note: See TracChangeset for help on using the changeset viewer.