summaryrefslogtreecommitdiff
path: root/lib/misc.c
diff options
context:
space:
mode:
authorewt <devnull@localhost>1999-01-08 03:10:12 +0000
committerewt <devnull@localhost>1999-01-08 03:10:12 +0000
commit8bef8b932c7b913a12f58d21615336299e0624bb (patch)
treee30f05f69430da7eda1f998e0d2f52d835d949cc /lib/misc.c
parent0c69b1363d0f61e1f78c33e334987d8429d45996 (diff)
downloadlibrpm-tizen-8bef8b932c7b913a12f58d21615336299e0624bb.tar.gz
librpm-tizen-8bef8b932c7b913a12f58d21615336299e0624bb.tar.bz2
librpm-tizen-8bef8b932c7b913a12f58d21615336299e0624bb.zip
added currentDirectory()
CVS patchset: 2678 CVS date: 1999/01/08 03:10:12
Diffstat (limited to 'lib/misc.c')
-rw-r--r--lib/misc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/misc.c b/lib/misc.c
index 51da6178d..6c2d1d758 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -364,3 +364,17 @@ int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) {
return 0;
}
+
+char * currentDirectory(void) {
+ int currDirLen;
+ char * currDir;
+
+ currDirLen = 50;
+ currDir = malloc(currDirLen);
+ while (!getcwd(currDir, currDirLen) && errno == ERANGE) {
+ currDirLen += 50;
+ currDir = realloc(currDir, currDirLen);
+ }
+
+ return currDir;
+}