[Bug 327846] Re: does not use input output directory properly

themusicgod1 themusicgod1 at zworg.com
Tue Feb 10 23:20:20 UTC 2009


** Attachment added: "this'll fix it."
   http://launchpadlibrarian.net/22478789/patch

** Description changed:

  Binary package hint: latex2rtf
  
  latex2rtf seems to allow, via -o commandline argument set, to specify
  the location of an output file.  However the directory, at least for '.'
  is not listened to, even if given.  The result is stored in the right
  filename, but in the home directory instead of the directory specified.
  This is at least the case when the input file is in the home directory,
  and the program is run from another directory.
  
  example:
  
  jcliff at CDD4:~/mirror/www.spiritsd.ca/test$ ls ~/*.tex
  /home/jcliff/something.tex
  jcliff at CDD4:~/mirror/www.spiritsd.ca/test$ latex2rtf -o ./out.rtf ~/something.tex 
  jcliff at CDD4:~/mirror/www.spiritsd.ca/test$ ls *.rtf
  ls: cannot access *.rtf: No such file or directory
  jcliff at CDD4:~/mirror/www.spiritsd.ca/test$ ls ~/*.rtf
  /home/jcliff/out.rtf  /home/jcliff/something.rtf
  
  what should happen
  
  jcliff at CDD4:~/mirror/www.spiritsd.ca/test$ ls ~/*.tex
  /home/jcliff/something.tex
  jcliff at CDD4:~/mirror/www.spiritsd.ca/test$ latex2rtf -o ./out.rtf ~/something.tex 
  jcliff at CDD4:~/mirror/www.spiritsd.ca/test$ ls *.rtf
+ out.rtf
  
  Looking through the code it looks like it does something strange with slashes in teh filename itself.
  (gdb) next
  0x1e3d120 "/home/jcliff/./out.rtf
  
  specifically, at main.c at lines 743-747 seems to be the issue:
  
  <code>
          if (g_home_dir)
              name = strdup_together(g_home_dir, filename);
          else
              name = strdup(filename);
  </code>
  
  Where 'name' is the output file name, to be opened with fopen on the
  next line.  The 'else' condition is what I would consider the desirable
  one, and seems to do what it needs to; opens the file at that location,
  not at some location that was not specified(file name under the home
  directory).  I tested the 'else' condition and it does output to the
  correct directory.
  
  So what I see is that there are two options here.   One, the default, somewhat confusing behaviour can be kept, and there's probably a way to force the 'else' condition to occur.  
  On the other hand, there could be an option to force the odd behaviour, and have the default behaviour be that when -o is specified the next argument is what is, in fact, opened as the output file, bounded by whatever fopen can handle(which looks like quite a bit).
  
  'dir' doesn't occur in /usr/share/latex2rtf/cfg, so it doesn't look like
  there's a configuration option to set either as default behaviour
+ 
+ edit: missed a crucial word.

-- 
does not use input output directory properly
https://bugs.launchpad.net/bugs/327846
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs




More information about the universe-bugs mailing list