Index: get_path.c =================================================================== --- get_path.c (revision 26046) +++ get_path.c (working copy) @@ -23,6 +23,11 @@ #include #endif +#ifdef __OS2__ +#define INCL_DOS +#include +#endif + char *get_path(const char *filename){ char *homedir; char *buff; @@ -56,6 +61,25 @@ exedir[imax]='\0'; homedir = exedir; } +#elif defined(__OS2__) + { + PPIB ppib; + char path[ 260 ]; + + // Get process info blocks + DosGetInfoBlocks( NULL, &ppib ); + + // Get full path of the executable + DosQueryModuleName( ppib->pib_hmte, sizeof( path ), path ); + + // Truncate name part including last back slash + *strrchr( path, '\\' ) = 0; + + // Convert back slash to slash + _fnslashify( path ); + + homedir = path; + } #else return NULL; #endif Index: subreader.c =================================================================== --- subreader.c (revision 26046) +++ subreader.c (working copy) @@ -1835,8 +1835,9 @@ subcnt = 0; tmp = strrchr(fname,'/'); -#ifdef WIN32 +#if defined(WIN32) || defined(__OS2__) if(!tmp)tmp = strrchr(fname,'\\'); + if(!tmp)tmp = strrchr(fname,':'); #endif // extract filename & dirname from fname