diff options
Diffstat (limited to 'source/common/dmextern.c')
| -rw-r--r-- | source/common/dmextern.c | 47 | 
1 files changed, 20 insertions, 27 deletions
diff --git a/source/common/dmextern.c b/source/common/dmextern.c index b78304067f190..002d08860af6d 100644 --- a/source/common/dmextern.c +++ b/source/common/dmextern.c @@ -279,48 +279,41 @@ Cleanup:  ACPI_STATUS  AcpiDmAddToExternalFileList ( -    char                    *PathList) +    char                    *Pathname)  {      ACPI_EXTERNAL_FILE      *ExternalFile; -    char                    *Path; -    char                    *TmpPath; +    char                    *LocalPathname; -    if (!PathList) +    if (!Pathname)      {          return (AE_OK);      } -    Path = strtok (PathList, ","); - -    while (Path) +    LocalPathname = ACPI_ALLOCATE (strlen (Pathname) + 1); +    if (!LocalPathname)      { -        TmpPath = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (Path) + 1); -        if (!TmpPath) -        { -            return (AE_NO_MEMORY); -        } - -        ACPI_STRCPY (TmpPath, Path); +        return (AE_NO_MEMORY); +    } -        ExternalFile = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_FILE)); -        if (!ExternalFile) -        { -            ACPI_FREE (TmpPath); -            return (AE_NO_MEMORY); -        } +    ExternalFile = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_FILE)); +    if (!ExternalFile) +    { +        ACPI_FREE (LocalPathname); +        return (AE_NO_MEMORY); +    } -        ExternalFile->Path = TmpPath; +    /* Take a copy of the file pathname */ -        if (AcpiGbl_ExternalFileList) -        { -            ExternalFile->Next = AcpiGbl_ExternalFileList; -        } +    strcpy (LocalPathname, Pathname); +    ExternalFile->Path = LocalPathname; -        AcpiGbl_ExternalFileList = ExternalFile; -        Path = strtok (NULL, ","); +    if (AcpiGbl_ExternalFileList) +    { +        ExternalFile->Next = AcpiGbl_ExternalFileList;      } +    AcpiGbl_ExternalFileList = ExternalFile;      return (AE_OK);  }  | 
