~ubuntu-branches/ubuntu/wily/luatex/wily

« back to all changes in this revision

Viewing changes to source/texk/kpathsea/kdefault.c

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2010-04-29 00:47:19 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20100429004719-o42etkqe90n97b9e
Tags: 0.60.1-1
* new upstream release, adapt build-script patch
* disable patch: upstream-epstopdf_cc_no_xpdf_patching, included upstream
* disable patch: libpoppler-0.12, not needed anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
   make a program `default' from it, since we have a target `default';
4
4
   and OSF/1 make doesn't understand .PHONY.)
5
5
 
6
 
   Copyright 1993, 1994, 1996, 2008 Karl Berry.
 
6
   Copyright 1993, 1994, 1996, 2008, 2009 Karl Berry.
7
7
   Copyright 2002, 2005 Olaf Weber.
8
8
 
9
9
   This library is free software; you can redistribute it and/or
28
28
/* Check for leading colon first, then trailing, then doubled, since
29
29
   that is fastest.  Usually it will be leading or trailing.  */
30
30
 
31
 
string 
32
 
kpathsea_expand_default (kpathsea kpse, const_string path,  const_string fallback)
 
31
string
 
32
kpathsea_expand_default (kpathsea kpse, const_string path,
 
33
                         const_string fallback)
33
34
{
34
35
  unsigned path_length;
35
36
  string expansion;
36
37
  (void)kpse; /* currenty not used */
37
 
  
 
38
 
38
39
  /* The default path better not be null.  */
39
40
  assert (fallback);
40
 
  
 
41
 
41
42
  if (path == NULL)
42
43
    expansion = xstrdup (fallback);
43
44
 
80
81
          expansion = xstrdup(path);
81
82
        }
82
83
    }
83
 
  
 
84
 
84
85
  return expansion;
85
86
}
86
87
#if defined (KPSE_COMPAT_API)
87
 
string 
 
88
string
88
89
kpse_expand_default (const_string path,  const_string fallback)
89
90
{
90
91
    return kpathsea_expand_default (kpse_def, path, fallback);
98
99
test_expand_default (const_string path, const_string def)
99
100
{
100
101
  string answer;
101
 
  
 
102
 
102
103
  printf ("Expansion of `%s':\t", path ? path : "(nil)");
103
104
  answer = kpse_expand_default (path, def);
104
105
  puts (answer);
115
116
  test_expand_default (ENV_SEP_STRING, default_path);
116
117
  test_expand_default (ENV_SEP_STRING "first", default_path);
117
118
  test_expand_default ("last" ENV_SEP_STRING, default_path);
118
 
  test_expand_default ("middle" ENV_SEP_STRING ENV_SEP_STRING "elddim", default_path);
119
 
  
 
119
  test_expand_default ("middle" ENV_SEP_STRING ENV_SEP_STRING "elddim",
 
120
                       default_path);
 
121
 
120
122
  return 0;
121
123
}
122
124