2
*******************************************************************************
4
* Copyright (C) 1999-2000, International Business Machines
5
* Corporation and others. All Rights Reserved.
7
*******************************************************************************
8
* file name: toolutil.c
10
* tab size: 8 (not used)
13
* created on: 1999nov19
14
* created by: Markus W. Scherer
16
* This file contains utility functions for ICU tools like genccode.
21
# define WIN32_LEAN_AND_MEAN
24
#include "unicode/utypes.h"
25
#include "unicode/putil.h"
31
getLongPathname(const char *pathname) {
33
/* anticipate problems with "short" pathnames */
34
static WIN32_FIND_DATA info;
35
HANDLE file=FindFirstFile(pathname, &info);
36
if(file!=INVALID_HANDLE_VALUE) {
37
if(info.cAlternateFileName[0]!=0) {
38
/* this file has a short name, get and use the long one */
39
const char *basename=findBasename(pathname);
40
if(basename!=pathname) {
41
/* prepend the long filename with the original path */
42
uprv_memmove(info.cFileName+(basename-pathname), info.cFileName, uprv_strlen(info.cFileName)+1);
43
uprv_memcpy(info.cFileName, pathname, basename-pathname);
45
pathname=info.cFileName;
54
findBasename(const char *filename) {
55
const char *basename=uprv_strrchr(filename, U_FILE_SEP_CHAR);