-const char miscutil_rcs[] = "$Id: miscutil.c,v 1.26 2001/12/30 14:07:32 steudten Exp $";
+const char miscutil_rcs[] = "$Id: miscutil.c,v 1.28 2002/03/03 09:18:03 joergs Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/miscutil.c,v $
*
* Revisions :
* $Log: miscutil.c,v $
+ * Revision 1.28 2002/03/03 09:18:03 joergs
+ * Made jumbjuster work on AmigaOS again.
+ *
+ * Revision 1.27 2002/01/21 00:52:32 jongfoster
+ * Adding string_join()
+ *
* Revision 1.26 2001/12/30 14:07:32 steudten
* - Add signal handling (unix)
* - Add SIGHUP handler (unix)
if(dir)
{
- strncpy(path,dir,512);
+ if(dir[0] == '.')
+ {
+ if(dir[1] == '/')
+ {
+ strncpy(path,dir+2,512);
+ }
+ else
+ {
+ strncpy(path,dir+1,512);
+ }
+ }
+ else
+ {
+ strncpy(path,dir,512);
+ }
path[511]=0;
} else {
path[0]=0;
}
if ((dir == NULL) || (*dir == '\0') /* No directory specified */
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__OS2__)
|| (*file == '\\') || (file[1] == ':') /* Absolute path (DOS) */
-#else /* ifndef _WIN32 */
+#else /* ifndef _WIN32 || __OS2__ */
|| (*file == '/') /* Absolute path (U*ix) */
-#endif /* ifndef _WIN32 */
+#endif /* ifndef _WIN32 || __OS2__ */
)
{
return strdup(file);
#endif /* defined unix */
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__OS2__)
if(path[strlen(path)-1] != '\\')
{
strcat(path, "\\");
}
-#else /* ifndef _WIN32 */
+#else /* ifndef _WIN32 || __OS2__ */
if(path[strlen(path)-1] != '/')
{
strcat(path, "/");
}
-#endif /* ifndef _WIN32 */
+#endif /* ifndef _WIN32 || __OS2__ */
strcat(path, file);
return path;