Deleted Added
full compact
adfile.c (229989) adfile.c (235945)
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
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, '\\');
301 /* Convert backslashes to slashes in the entire path */
302
303 UtConvertBackslashes (DirectoryPath);
304
305 /* Backup to last slash or colon */
306
307 Substring = strrchr (DirectoryPath, '/');
302 if (!Substring)
303 {
308 if (!Substring)
309 {
304 Substring = strrchr (DirectoryPath, '/');
305 if (!Substring)
306 {
307 Substring = strrchr (DirectoryPath, ':');
308 }
310 Substring = strrchr (DirectoryPath, ':');
309 }
310
311 }
312
313 /* Extract the simple filename */
314
311 if (!Substring)
312 {
315 if (!Substring)
316 {
317 Filename = FlStrdup (DirectoryPath);
313 DirectoryPath[0] = 0;
318 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;
319 }
320 else
321 {
322 Filename = FlStrdup (Substring + 1);
323 *(Substring+1) = 0;
324 }
325
326 if (!Filename)
327 {
328 return (AE_NO_MEMORY);
329 }
330
331 *OutDirectoryPath = DirectoryPath;
332 *OutFilename = Filename;
329
330 return (AE_OK);
331}
332
333
333 return (AE_OK);
334}
335
336