~reviczky/luatex/luatex-svn

« back to all changes in this revision

Viewing changes to source/texk/kpathsea/win32/mktexupdmain.c

  • Committer: Adam Reviczky
  • Date: 2015-03-29 18:56:26 UTC
  • Revision ID: adam.reviczky@kclalumni.net-20150329185626-7j7tmwyfpa69lqwo
Revision 5213

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <kpathsea/kpathsea.h>
 
2
 
 
3
#include "mktexupd.h"
 
4
 
 
5
int main(int argc, char **argv)
 
6
{
 
7
  char dir[256];
 
8
  char file[256];
 
9
  char path[256];
 
10
  char *p;
 
11
  int i;
 
12
 
 
13
  kpse_set_program_name (argv[0], NULL);
 
14
  if(argc != 3) {
 
15
    fprintf(stderr, "%s:: usage: %s DIR FILE\n", argv[0], argv[0]);
 
16
    return 1;
 
17
  }
 
18
  strcpy(dir, argv[1]);
 
19
  strcpy(file, argv[2]);
 
20
  for(p = dir; *p; ++p) {
 
21
    if(*p == '\\') *p = '/';
 
22
    else if (IS_KANJI(p)) p++;
 
23
  }
 
24
  i = strlen(dir);
 
25
  while(dir[i-1] == '/')
 
26
    i--;
 
27
  dir[i] = '\0';
 
28
  strcpy(path, dir);
 
29
  strcat(path, "/");
 
30
  strcat(path, file);
 
31
  mktexupd(path);
 
32
  return 0;
 
33
}