diff --git a/src/cpp.c b/src/cpp.c
index 42bb50fbf617975045578480bd8c5f1e2c2f79ef..97185ade9446d63e050c7a64afc2e9957968ff3c 100644
--- a/src/cpp.c
+++ b/src/cpp.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: cpp.c,v 1.174 2008/06/13 21:14:28 marcus Exp $
+|| $Id: cpp.c,v 1.175 2008/06/29 12:40:47 marcus Exp $
 */
 
 #include "global.h"
@@ -1507,18 +1507,7 @@ static void insert_current_dir_as_string(struct cpp *this,
                                          struct string_builder *tmp)
 {
   ref_push_string(this->current_file);
-#ifdef __NT__
-  push_constant_text("..");
-  f_combine_path_nt(2);
-#else
-#ifdef __amigaos__
-  push_constant_text("/");
-  f_combine_path_amigaos(2);
-#else
-  push_constant_text("..");
-  f_combine_path_unix(2);
-#endif
-#endif
+  SAFE_APPLY_MASTER("dirname",1);
   PUSH_STRING_SHIFT(Pike_sp[-1].u.string->str, Pike_sp[-1].u.string->len,
                     Pike_sp[-1].u.string->size_shift, tmp);
   pop_stack();
diff --git a/src/testsuite.in b/src/testsuite.in
index a9887b251fd7d60c8ef576bb17fffe7a89e37fcb..19fce8227c900ff3a13065e21fbbf5d209768209 100644
--- a/src/testsuite.in
+++ b/src/testsuite.in
@@ -1,5 +1,5 @@
 START_MARKER
-test_true([["$Id: testsuite.in,v 1.833 2008/06/28 17:18:37 nilsson Exp $"]]);
+test_true([["$Id: testsuite.in,v 1.834 2008/06/29 12:40:47 marcus Exp $"]]);
 
 // This triggered a bug only if run sufficiently early.
 test_compile_any([[#pike 7.2]])
@@ -8500,13 +8500,7 @@ test_true( rm("conftest.h") )
 
 test_true(intp(__LINE__))
 test_true(stringp(__FILE__))
-test_eq(combine_path(__FILE__,
-#ifdef __amigaos__
-"/"
-#else
-".."
-#endif
-),__DIR__)
+test_eq(dirname(__FILE__),__DIR__)
 test_true(stringp(__DATE__))
 test_true([[ sscanf(__DATE__, "%3s %d %d", string m, int d, int y) == 3 &&
 	     search(({"Jan", "Feb", "Mar", "Apr", "May", "Jun",