1/******************************************************************************
2 *
3 * Module Name: adfile - Application-level disassembler file support routines
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2012, Intel Corp.
--- 284 unchanged lines hidden (view full) ---
293 /* Get the path to the input filename's directory */
294
295 DirectoryPath = FlStrdup (InputPath);
296 if (!DirectoryPath)
297 {
298 return (AE_NO_MEMORY);
299 }
300
301 Substring = strrchr (DirectoryPath, '\\');
302 if (!Substring)
303 {
304 Substring = strrchr (DirectoryPath, '/');
305 if (!Substring)
306 {
307 Substring = strrchr (DirectoryPath, ':');
308 }
309 }
310
311 if (!Substring)
312 {
313 DirectoryPath[0] = 0;
314 Filename = FlStrdup (InputPath);
315 }
316 else
317 {
318 Filename = FlStrdup (Substring + 1);
319 *(Substring+1) = 0;
320 }
321
322 if (!Filename)
323 {
324 return (AE_NO_MEMORY);
325 }
326
327 *OutDirectoryPath = DirectoryPath;
328 *OutFilename = Filename;
329
330 return (AE_OK);
331}
332
333
2 *
3 * Module Name: adfile - Application-level disassembler file support routines
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2012, Intel Corp.
--- 284 unchanged lines hidden (view full) ---
293 /* Get the path to the input filename's directory */
294
295 DirectoryPath = FlStrdup (InputPath);
296 if (!DirectoryPath)
297 {
298 return (AE_NO_MEMORY);
299 }
300
301 Substring = strrchr (DirectoryPath, '\\');
302 if (!Substring)
303 {
304 Substring = strrchr (DirectoryPath, '/');
305 if (!Substring)
306 {
307 Substring = strrchr (DirectoryPath, ':');
308 }
309 }
310
311 if (!Substring)
312 {
313 DirectoryPath[0] = 0;
314 Filename = FlStrdup (InputPath);
315 }
316 else
317 {
318 Filename = FlStrdup (Substring + 1);
319 *(Substring+1) = 0;
320 }
321
322 if (!Filename)
323 {
324 return (AE_NO_MEMORY);
325 }
326
327 *OutDirectoryPath = DirectoryPath;
328 *OutFilename = Filename;
329
330 return (AE_OK);
331}
332
333