groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff] Minor soelim patch


From: Jörgen Grahn
Subject: [Groff] Minor soelim patch
Date: Mon, 20 Jun 2005 20:27:37 +0200
User-agent: Mutt/1.5.9i

Here's another tiny bug fix against latest CVS. 

When soelim wrote error messages about being unable to open files, the
reported file name tended to have garbage characters appended to it.
Please apply.

('const char * string::contents() const' is devious. Wouldn't surprise me if
it is used incorrectly elsewhere, but I haven't checked in detail.)

BR,
/Jörgen

Index: src/preproc/soelim/soelim.cpp
===================================================================
RCS file: /cvsroot/groff/groff/src/preproc/soelim/soelim.cpp,v
retrieving revision 1.6
diff -u -r1.6 soelim.cpp
--- src/preproc/soelim/soelim.cpp       26 May 2005 21:02:01 -0000      1.6
+++ src/preproc/soelim/soelim.cpp       20 Jun 2005 19:14:06 -0000
@@ -159,12 +159,12 @@
                                                    &file_name_in_path);
   int err = errno;
   string whole_filename(file_name_in_path ? file_name_in_path : filename);
+  whole_filename += '\0';
   a_delete file_name_in_path;
   if (fp == 0) {
     error("can't open `%1': %2", whole_filename.contents(), strerror(err));
     return 0;
   }
-  whole_filename += '\0';
   current_filename = whole_filename.contents();
   current_lineno = 1;
   set_location();


-- 
  // Jörgen Grahn       "Koka lopplummer, bada Ross, loppor borta."
\X/ <address@hidden>                                   -- Jonas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]