Commit 22264cb2 authored by Albert Astals Cid's avatar Albert Astals Cid

Make it compile

Sorry :-/
parent 44bf99a7
...@@ -317,88 +317,6 @@ GBool isAbsolutePath(char *path) { ...@@ -317,88 +317,6 @@ GBool isAbsolutePath(char *path) {
#endif #endif
} }
GooString *makePathAbsolute(GooString *path) {
#ifdef VMS
//---------- VMS ----------
char buf[PATH_MAX+1];
if (!isAbsolutePath(path->getCString())) {
if (getcwd(buf, sizeof(buf))) {
path->insert(0, buf);
}
}
return path;
#elif defined(_WIN32)
//---------- Win32 ----------
char buf[MAX_PATH];
char *fp;
buf[0] = '\0';
if (!GetFullPathName(path->getCString(), MAX_PATH, buf, &fp)) {
path->clear();
return path;
}
path->clear();
path->append(buf);
return path;
#elif defined(ACORN)
//---------- RISCOS ----------
path->insert(0, '@');
return path;
#elif defined(MACOS)
//---------- MacOS ----------
path->del(0, 1);
return path;
#else
//---------- Unix and OS/2+EMX ----------
struct passwd *pw;
char buf[PATH_MAX+1];
GooString *s;
char *p1, *p2;
int n;
if (path->getChar(0) == '~') {
if (path->getChar(1) == '/' ||
#ifdef __EMX__
path->getChar(1) == '\\' ||
#endif
path->getLength() == 1) {
path->del(0, 1);
s = getHomeDir();
path->insert(0, s);
delete s;
} else {
p1 = path->getCString() + 1;
#ifdef __EMX__
for (p2 = p1; *p2 && *p2 != '/' && *p2 != '\\'; ++p2) ;
#else
for (p2 = p1; *p2 && *p2 != '/'; ++p2) ;
#endif
if ((n = p2 - p1) > PATH_MAX)
n = PATH_MAX;
strncpy(buf, p1, n);
buf[n] = '\0';
if ((pw = getpwnam(buf))) {
path->del(0, p2 - p1 + 1);
path->insert(0, pw->pw_dir);
}
}
} else if (!isAbsolutePath(path->getCString())) {
if (getcwd(buf, sizeof(buf))) {
#ifndef __EMX__
path->insert(0, '/');
#endif
path->insert(0, buf);
}
}
return path;
#endif
}
time_t getModTime(char *fileName) { time_t getModTime(char *fileName) {
#ifdef _WIN32 #ifdef _WIN32
//~ should implement this, but it's (currently) only used in xpdf //~ should implement this, but it's (currently) only used in xpdf
......
...@@ -85,10 +85,6 @@ extern GooString *grabPath(char *fileName); ...@@ -85,10 +85,6 @@ extern GooString *grabPath(char *fileName);
// Is this an absolute path or file name? // Is this an absolute path or file name?
extern GBool isAbsolutePath(char *path); extern GBool isAbsolutePath(char *path);
// Make this path absolute by prepending current directory (if path is
// relative) or prepending user's directory (if path starts with '~').
extern GooString *makePathAbsolute(GooString *path);
// Get the modification time for <fileName>. Returns 0 if there is an // Get the modification time for <fileName>. Returns 0 if there is an
// error. // error.
extern time_t getModTime(char *fileName); extern time_t getModTime(char *fileName);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
// All changes made under the Poppler project to this file are licensed // All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later // under GPL version 2 or later
// //
// Copyright (C) 2005, 2007-2010 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005, 2007-2010, 2012 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2005 Jonathan Blandford <jrb@redhat.com> // Copyright (C) 2005 Jonathan Blandford <jrb@redhat.com>
// Copyright (C) 2006 Takashi Iwai <tiwai@suse.de> // Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
// Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com> // Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment