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 /* 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, '/'); |
308 if (!Substring) 309 { |
310 Substring = strrchr (DirectoryPath, ':'); |
311 } 312 |
313 /* Extract the simple filename */ 314 |
315 if (!Substring) 316 { |
317 Filename = FlStrdup (DirectoryPath); |
318 DirectoryPath[0] = 0; |
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; |
333 return (AE_OK); 334} 335 336 |