summaryrefslogtreecommitdiffstats
path: root/soundserver/artsplay.cc
diff options
context:
space:
mode:
Diffstat (limited to 'soundserver/artsplay.cc')
-rw-r--r--soundserver/artsplay.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/soundserver/artsplay.cc b/soundserver/artsplay.cc
index b8dec3d..a694cd3 100644
--- a/soundserver/artsplay.cc
+++ b/soundserver/artsplay.cc
@@ -42,13 +42,19 @@ static string absolutePath(const string& path)
{
if(path[0] == '/') return path;
- char buffer[PATH_MAX];
- getcwd(buffer,PATH_MAX);
+ int size = 4096;
- if(buffer[strlen(buffer)-1] == '/')
- return buffer + path;
- else
- return string(buffer) + '/' + path;
+ while (1) {
+ char buffer[size];
+ if (getcwd(buffer,size))
+ {
+ if(buffer[strlen(buffer)-1] == '/')
+ return buffer + path;
+ else
+ return string(buffer) + '/' + path;
+ }
+ size *= 2;
+ }
}
int main(int argc, char **argv)