+void get_absolute_pathname(const char *pathname, char * abs_pathname)
+{
+ char * ptr, *ptr1;
+ size_t size = DIR_NAME_SIZE;
+ abs_pathname[0] = '\0';
+
+ if(pathname[0] == '/')
+ {
+ strcat(abs_pathname, pathname);
+ return;
+ }
+
+ if(!getcwd(abs_pathname, size)){
+ g_warning("Can not get current working directory\n");
+ strcat(abs_pathname, pathname);
+ return;
+ }
+
+ strcat(abs_pathname,"/");
+
+ ptr = (char*)pathname;
+ ptr1 = ptr + 1;
+ while(*ptr == '.' && *ptr1 == '.'){
+ ptr += 3;
+ ptr1 = ptr + 1;
+ }
+ strcat(abs_pathname,ptr);
+}
+