From 1916bc0c2d90a006c5beac64adbda0ee86f950fd Mon Sep 17 00:00:00 2001
From: Mikhail S. Pobolovets <styx.mp@gmail.com>
Date: Sun, 25 Jan 2009 23:11:09 +0200
Subject: [PATCH] Originally by adamw
http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/mc/current/SOURCES/mc-concat.patch?view=markup
+ some additional modifications
Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
---
src/util.c | 12 ++++++++++--
src/util.h | 2 +-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/util.c b/src/util.c
index edc759a..e4cd308 100644
a
|
b
|
diff_two_paths (const char *first, const char *second) |
1247 | 1247 | |
1248 | 1248 | /* If filename is NULL, then we just append PATH_SEP to the dir */ |
1249 | 1249 | char * |
1250 | | concat_dir_and_file (const char *dir, const char *file) |
| 1250 | concat_dir_and_file (const char *dir, const char *filename) |
1251 | 1251 | { |
1252 | 1252 | int i = strlen (dir); |
1253 | | |
| 1253 | const char *file = filename; |
| 1254 | |
| 1255 | /* Return filename when dir is empty */ |
| 1256 | if (!i) return g_strdup (filename); |
| 1257 | |
| 1258 | /* Is this one: *file == PATH_SEP seems to be not fully portable? */ |
| 1259 | if (file != NULL && *file == PATH_SEP) |
| 1260 | file++; |
| 1261 | |
1254 | 1262 | if (dir [i-1] == PATH_SEP) |
1255 | 1263 | return g_strconcat (dir, file, (char *) NULL); |
1256 | 1264 | else |
diff --git a/src/util.h b/src/util.h
index 4e9a113..64e5843 100644
a
|
b
|
char *strip_password (char *path, int has_prefix); |
66 | 66 | const char *strip_home_and_password (const char *dir); |
67 | 67 | |
68 | 68 | const char *extension (const char *); |
69 | | char *concat_dir_and_file (const char *dir, const char *file); |
| 69 | char *concat_dir_and_file (const char *dir, const char *filename); |
70 | 70 | const char *unix_error_string (int error_num); |
71 | 71 | const char *skip_separators (const char *s); |
72 | 72 | const char *skip_numbers (const char *s); |