+ eprintf("Path %s could not be accessed: %s\n", scanpath, strerror(errno));
+ errno = 0;
+ if (chdir(scanpath) || errno)
+ eprintf("Could not change directory to %s: %s\n", scanpath, strerror(errno));
+ apc_package_name = (uint8_t*) getcwd_basename();
+ if (scanner_scandir(dirp))
+ eprintf(strerror(errno));
+ ir_test();
+ ir_linker();
+ ir_condenser();
+ free_and_exit(EXIT_SUCCESS);
+}
+
+static
+char* getcwd_basename
+( void )
+{ char* path_iter,* path_buf,* path;
+ int pages;
+ path = NULL;
+ pages = 1;
+ try_cwd:
+ path_buf = (char*) malloc(MAXSTR * pages);
+ errno = 0;
+ getcwd(path_buf, MAXSTR * pages);
+ if (errno == ERANGE)
+ { pages++;
+ free(path_buf);
+ goto try_cwd;