Ignore:
Timestamp:
Mar 12, 2006, 6:02:46 PM (19 years ago)
Author:
bird
Message:

applied OS/2 patches (manually).

Location:
trunk/texinfo/makeinfo
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/texinfo/makeinfo/files.c

    r2617 r2619  
    202202
    203203  fullpath
    204     = get_file_info_in_path (filename, use_path ? include_files_path : NULL, 
     204    = get_file_info_in_path (filename, use_path ? include_files_path : NULL,
    205205                             &fileinfo);
    206206
     
    369369}
    370370
     371#if defined (__EMX__)
     372/* Convert DOS slashes to UNIX slashes. */
     373static char *slashify (char *filename)
     374{
     375  if (filename)
     376    for (char *s = strchr (filename, '/'); s; s = strchr (s + 1, '/')
     377      *s = '/';
     378  return filename;
     379}
     380#endif
     381
    371382/* Return just the simple part of the filename; i.e. the
    372383   filename without the path information, or extensions.
     
    375386filename_part (char *filename)
    376387{
     388#if defined (__EMX__)
     389  char *basename = filename_non_directory (slashify (filename));
     390#else
    377391  char *basename = filename_non_directory (filename);
     392#endif
    378393
    379394#ifdef REMOVE_OUTPUT_EXTENSIONS
     
    394409  char *result = NULL;
    395410  int i;
     411#ifdef __EMX__
     412  slashify (filename);
     413#endif
    396414
    397415  filename = expand_filename (filename, "");
     
    414432  int initial_character;
    415433  char *result;
     434#ifdef __EMX__
     435  slashify (filename);
     436#endif
    416437
    417438  /* No filename given? */
    418439  if (!filename || !*filename)
    419440    return xstrdup ("");
    420  
     441
    421442  /* Already absolute? */
    422443  if (IS_ABSOLUTE (filename) ||
     
    443464      strcat (localdir, "/");
    444465      strcat (localdir, filename);
     466#ifdef __EMX__
     467      slashify (localdir);
     468#endif
    445469      result = xstrdup (localdir);
    446470      free (localdir);
     
    505529{
    506530  int i;
     531#ifdef __EMX__
     532  slashify (filename);
     533  slashify (input_name);
     534#endif
    507535
    508536  if (filename)
     
    542570      /* Make it so that relative names work. */
    543571      char *result;
    544      
     572
    545573      i = strlen (input_name) - 1;
    546574
     
    580608  char *lastdot, *p;
    581609
    582 #ifdef _PC_NAME_MAX
     610#if defined (_PC_NAME_MAX) && !defined(__EMX__) /* bird: _PC_NAME_MAX => 14 on OS/2. FIXME!!! */
    583611  maxlen = pathconf (fname, _PC_NAME_MAX);
    584612  if (maxlen < 1)
     
    657685      || FILENAME_CMP (current_output_filename, ALSO_NULL_DEVICE) == 0)
    658686    return;
    659    
     687
    660688  /* We need the HTML header in the output,
    661689     to get a proper output_position.  */
  • trunk/texinfo/makeinfo/makeinfo.c

    r2617 r2619  
    543543  int reading_from_stdin = 0;
    544544
     545#ifdef __EMX__
     546  _response (&argc, &argv);
     547  _wildcard (&argc, &argv);
     548  if (argc == 1 && isatty (STDIN_FILENO))
     549    usage (0);
     550#endif
     551
    545552#ifdef HAVE_SETLOCALE
    546553  /* Do not use LC_ALL, because LC_NUMERIC screws up the scanf parsing
     
    658665            {
    659666              macro_expansion_filename = optarg;
    660               macro_expansion_output_stream
    661                 = strcmp (optarg, "-") == 0 ? stdout : fopen (optarg, "w");
     667#if defined(__EMX__)
     668              if (strcmp (optarg, "-") == 0)
     669                {
     670                  macro_expansion_output_stream = stdout;
     671                  freopen(NULL, FOPEN_WBIN, stdout);
     672                }
     673              else
     674                macro_expansion_output_stream = fopen (optarg, FOPEN_WBIN);
     675#else
     676              macro_expansion_output_stream =
     677                  strcmp (optarg, "-") == 0 ? stdout : fopen (optarg, "w");
     678#endif
    662679              if (!macro_expansion_output_stream)
    663680                error (_("%s: could not open macro expansion output `%s'"),
     
    9991016          sprintf (end_block, "\n%cend ", COMMAND_PREFIX);
    10001017          if (executing_string && strstr (string, end_block))
    1001             line_error (_("Multiline command %c%s used improperly"), 
     1018            line_error (_("Multiline command %c%s used improperly"),
    10021019                COMMAND_PREFIX, command);
    10031020          else
     
    16321649        real_output_filename = xstrdup (real_output_filename);
    16331650
    1634       output_stream = fopen (real_output_filename, "w");
     1651#if defined(__EMX__)
     1652     output_stream = fopen (real_output_filename, FOPEN_WBIN);
     1653#else
     1654     output_stream = fopen (real_output_filename, "w");
     1655#endif
    16351656    }
    16361657
     
    33413362          add_word_args ("\"%s\"", fullname);
    33423363          add_html_elt (" alt=");
    3343           add_word_args ("\"%s\">", 
     3364          add_word_args ("\"%s\">",
    33443365              escape_string (*alt_arg ? text_expansion (alt_arg) : fullname));
    33453366
     
    33783399          strcpy (txtname, name_arg);
    33793400          strcat (txtname, ".txt");
    3380           image_file = fopen (txtname, "r");
     3401          image_file = fopen (txtname, FOPEN_RTXT); /* bird: text */
    33813402          if (image_file == NULL)
    33823403            {
     
    33843405                                               include_files_path, &file_info);
    33853406              if (txtpath != NULL)
    3386                 image_file = fopen (txtpath, "r");
     3407                image_file = fopen (txtpath, FOPEN_RTXT); /* bird: text */
    33873408            }
    33883409
     
    34413462                  if (image_in_brackets)
    34423463                    add_char (']');
    3443                  
     3464
    34443465                  if (use_magic_cookie)
    34453466                    add_char ('"');
     
    36823703             expand to a context-sensitive macro (e.g. @xref) and produce
    36833704             spurious warnings */
    3684           input_text_offset++; 
     3705          input_text_offset++;
    36853706          execute_string ("%s", value);
    36863707          input_text_offset--;
  • trunk/texinfo/makeinfo/node.c

    r2617 r2619  
    504504    char *optr = otem;
    505505    int need_old = 0;
    506    
     506
    507507    for (; *optr; optr++)
    508508      {
     
    513513          }
    514514      }
    515    
     515
    516516    if (need_old)
    517517      {
     
    974974
    975975      if (!splitting && no_headers)
    976         { /* cross refs need a name="#anchor" even if not writing headers */ 
     976        { /* cross refs need a name="#anchor" even if not writing headers */
    977977          add_html_names (node);
    978978        }
     
    984984          add_word_args ("<p>%s\n", splitting ? "" : "<hr>");
    985985
    986           /* In the split HTML case, the filename is wrong for the 
     986          /* In the split HTML case, the filename is wrong for the
    987987             old-style converted names, but we'll add them anyway, for
    988988             consistency.  (And we need them in the normal (not
     
    995995              add_word ((char *) _("Next:"));
    996996              add_word ("&nbsp;");
    997              
     997
    998998              add_word ("<a rel=\"next\" accesskey=\"n\" href=\"");
    999999              add_anchor_name (tem, 1);
    10001000              tem = escape_string (tem);
    10011001              add_word_args ("\">%s</a>", tem);
    1002              
     1002       
    10031003              free (tem);
    10041004
     
    18801880                  char *split_basename = filename_part (split_filename);
    18811881
     1882#ifdef __EMX__
     1883                  fd = open (split_filename,
     1884                             O_WRONLY|O_TRUNC|O_CREAT|O_BINARY, 0666);
     1885#else
    18821886                  fd = open (split_filename, O_WRONLY|O_TRUNC|O_CREAT, 0666);
     1887#endif
    18831888                  if (fd < 0
    18841889                      || write (fd, the_header, header_size) != header_size
     
    19181923       original again.  We must use `output_stream', or
    19191924       write_tag_table_indirect () won't know where to place the output. */
     1925#ifdef __EMX__
     1926    output_stream = fopen (filename, FOPEN_WBIN);
     1927#else
    19201928    output_stream = fopen (filename, "w");
     1929#endif
    19211930    if (!output_stream)
    19221931      {
Note: See TracChangeset for help on using the changeset viewer.