2009-07-20 06:35:20 -04:00
|
|
|
$OpenBSD: patch-src_celutil_unixdirectory_cpp,v 1.2 2009/07/20 10:35:20 ajacoutot Exp $
|
Import celestia-1.4.1
Unlike most planetarium software, Celestia doesn't confine you to the
surface of the Earth. You can travel throughout the solar system, to any
of over 100,000 stars, or even beyond the galaxy.
All movement in Celestia is seamless; the exponential zoom feature lets
you explore space across a huge range of scales, from galaxy clusters
down to spacecraft only a few meters across. A 'point-and-goto'
interface makes it simple to navigate through the universe to the object
you want to visit.
Celestia is expandable. It comes with a large catalog of stars,
galaxies, planets, moons, asteroids, comets, and spacecraft. If that's
not enough, you can download dozens of easy to install add-ons with more
objects.
Available flavors:
lua - add Lua scripting engine (extension language support)
ok jasper@
2007-07-16 13:39:21 -04:00
|
|
|
$NetBSD: patch-am,v 1.1 2006/12/12 19:31:37 joerg Exp $
|
2009-07-20 06:35:20 -04:00
|
|
|
--- src/celutil/unixdirectory.cpp.orig Mon Jun 22 17:44:24 2009
|
|
|
|
+++ src/celutil/unixdirectory.cpp Mon Jul 20 11:55:18 2009
|
Import celestia-1.4.1
Unlike most planetarium software, Celestia doesn't confine you to the
surface of the Earth. You can travel throughout the solar system, to any
of over 100,000 stars, or even beyond the galaxy.
All movement in Celestia is seamless; the exponential zoom feature lets
you explore space across a huge range of scales, from galaxy clusters
down to spacecraft only a few meters across. A 'point-and-goto'
interface makes it simple to navigate through the universe to the object
you want to visit.
Celestia is expandable. It comes with a large catalog of stars,
galaxies, planets, moons, asteroids, comets, and spacecraft. If that's
not enough, you can download dozens of easy to install add-ons with more
objects.
Available flavors:
lua - add Lua scripting engine (extension language support)
ok jasper@
2007-07-16 13:39:21 -04:00
|
|
|
@@ -7,11 +7,19 @@
|
|
|
|
// as published by the Free Software Foundation; either version 2
|
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
+#if defined(__OpenBSD__)
|
|
|
|
+#define NO_WORDEXP
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <dirent.h>
|
|
|
|
+#ifdef NO_WORDEXP
|
|
|
|
+#include <glob.h>
|
|
|
|
+#else
|
|
|
|
#include <wordexp.h>
|
|
|
|
+#endif
|
|
|
|
#include "directory.h"
|
|
|
|
|
|
|
|
using namespace std;
|
2009-07-20 06:35:20 -04:00
|
|
|
@@ -107,6 +115,19 @@ bool IsDirectory(const std::string& filename)
|
Import celestia-1.4.1
Unlike most planetarium software, Celestia doesn't confine you to the
surface of the Earth. You can travel throughout the solar system, to any
of over 100,000 stars, or even beyond the galaxy.
All movement in Celestia is seamless; the exponential zoom feature lets
you explore space across a huge range of scales, from galaxy clusters
down to spacecraft only a few meters across. A 'point-and-goto'
interface makes it simple to navigate through the universe to the object
you want to visit.
Celestia is expandable. It comes with a large catalog of stars,
galaxies, planets, moons, asteroids, comets, and spacecraft. If that's
not enough, you can download dozens of easy to install add-ons with more
objects.
Available flavors:
lua - add Lua scripting engine (extension language support)
ok jasper@
2007-07-16 13:39:21 -04:00
|
|
|
|
2009-07-20 06:35:20 -04:00
|
|
|
std::string WordExp(const std::string& filename)
|
|
|
|
{
|
Import celestia-1.4.1
Unlike most planetarium software, Celestia doesn't confine you to the
surface of the Earth. You can travel throughout the solar system, to any
of over 100,000 stars, or even beyond the galaxy.
All movement in Celestia is seamless; the exponential zoom feature lets
you explore space across a huge range of scales, from galaxy clusters
down to spacecraft only a few meters across. A 'point-and-goto'
interface makes it simple to navigate through the universe to the object
you want to visit.
Celestia is expandable. It comes with a large catalog of stars,
galaxies, planets, moons, asteroids, comets, and spacecraft. If that's
not enough, you can download dozens of easy to install add-ons with more
objects.
Available flavors:
lua - add Lua scripting engine (extension language support)
ok jasper@
2007-07-16 13:39:21 -04:00
|
|
|
+#ifdef NO_WORDEXP
|
|
|
|
+ glob_t g;
|
|
|
|
+ std::string expanded;
|
|
|
|
+ glob(filename.c_str(), GLOB_NOSORT | GLOB_TILDE, NULL, &g);
|
|
|
|
+ if (g.gl_matchc != 1) {
|
|
|
|
+ globfree(&g);
|
|
|
|
+ return filename;
|
|
|
|
+ } else {
|
|
|
|
+ expanded = g.gl_pathv[0];
|
|
|
|
+ globfree(&g);
|
|
|
|
+ return expanded;
|
|
|
|
+ }
|
|
|
|
+#else
|
2009-07-20 06:35:20 -04:00
|
|
|
#ifndef WORDEXP_PROBLEM
|
Import celestia-1.4.1
Unlike most planetarium software, Celestia doesn't confine you to the
surface of the Earth. You can travel throughout the solar system, to any
of over 100,000 stars, or even beyond the galaxy.
All movement in Celestia is seamless; the exponential zoom feature lets
you explore space across a huge range of scales, from galaxy clusters
down to spacecraft only a few meters across. A 'point-and-goto'
interface makes it simple to navigate through the universe to the object
you want to visit.
Celestia is expandable. It comes with a large catalog of stars,
galaxies, planets, moons, asteroids, comets, and spacecraft. If that's
not enough, you can download dozens of easy to install add-ons with more
objects.
Available flavors:
lua - add Lua scripting engine (extension language support)
ok jasper@
2007-07-16 13:39:21 -04:00
|
|
|
wordexp_t result;
|
|
|
|
std::string expanded;
|
2009-07-20 06:35:20 -04:00
|
|
|
@@ -133,4 +154,5 @@ std::string WordExp(const std::string& filename)
|
|
|
|
std::string expanded = filename;
|
|
|
|
#endif
|
Import celestia-1.4.1
Unlike most planetarium software, Celestia doesn't confine you to the
surface of the Earth. You can travel throughout the solar system, to any
of over 100,000 stars, or even beyond the galaxy.
All movement in Celestia is seamless; the exponential zoom feature lets
you explore space across a huge range of scales, from galaxy clusters
down to spacecraft only a few meters across. A 'point-and-goto'
interface makes it simple to navigate through the universe to the object
you want to visit.
Celestia is expandable. It comes with a large catalog of stars,
galaxies, planets, moons, asteroids, comets, and spacecraft. If that's
not enough, you can download dozens of easy to install add-ons with more
objects.
Available flavors:
lua - add Lua scripting engine (extension language support)
ok jasper@
2007-07-16 13:39:21 -04:00
|
|
|
return expanded;
|
|
|
|
+#endif
|
|
|
|
}
|