diff liboctave/file-ops.cc @ 7272:05ee52d7fad6

[project @ 2007-12-10 07:06:00 by jwe]
author jwe
date Mon, 10 Dec 2007 07:06:01 +0000
parents a1dbe9d80eee
children b166043585a8 84fb5019fb38
line wrap: on
line diff
--- a/liboctave/file-ops.cc	Mon Dec 10 06:52:51 2007 +0000
+++ b/liboctave/file-ops.cc	Mon Dec 10 07:06:01 2007 +0000
@@ -857,6 +857,16 @@
   return dir_sep_chars.find (c) != NPOS;
 }
 
+std::string
+file_ops::concat (const std::string& dir, const std::string& file)
+{
+  return dir.empty ()
+    ? file
+    : (is_dir_sep (dir[dir.length()-1])
+       ? dir + file
+       : dir + file_ops::dir_sep_char + file);
+}
+
 /*
 ;;; Local Variables: ***
 ;;; mode: C++ ***