aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl/src/systools_make.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2011-09-05 16:52:56 +0200
committerSiri Hansen <[email protected]>2011-09-05 16:52:56 +0200
commitff6c59699ef71acf04105223d617cbd9dc84b89f (patch)
treed931131fbdd2174d0ff4de4ed4fa5870fc96777c /lib/sasl/src/systools_make.erl
parent53475d05e282cf04c9d206240961363a7189c6e7 (diff)
downloadotp-ff6c59699ef71acf04105223d617cbd9dc84b89f.tar.gz
otp-ff6c59699ef71acf04105223d617cbd9dc84b89f.tar.bz2
otp-ff6c59699ef71acf04105223d617cbd9dc84b89f.zip
Fix bug in systools:make_tar when path given as just 'ebin'
If a path was given as ONLY 'ebin' and not for example './ebin', then systools:make_tar would fail with a function_clause exception in filename:join/1. The bug was in systools_make:appDir/1, which tried to find the parent directory of the given path. This function now uses library functions filename:basename and filename:dirname instead of general list manipulations.
Diffstat (limited to 'lib/sasl/src/systools_make.erl')
-rw-r--r--lib/sasl/src/systools_make.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sasl/src/systools_make.erl b/lib/sasl/src/systools_make.erl
index 7489ee58d2..5dc83e7b2a 100644
--- a/lib/sasl/src/systools_make.erl
+++ b/lib/sasl/src/systools_make.erl
@@ -1612,9 +1612,9 @@ var_dir(_Dir, _, _, []) ->
false.
appDir(AppDir) ->
- case reverse(filename:split(AppDir)) of
- ["ebin"|Dir] -> filename:join(reverse(Dir));
- _ -> AppDir
+ case filename:basename(AppDir) of
+ "ebin" -> filename:dirname(AppDir);
+ _ -> AppDir
end.
add_modules(Modules, Tar, AppDir, ToDir, Ext) ->