Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Diff of /src/manpath.c [c0f3f3] .. [5693c9] Maximize Restore

  Switch to side-by-side view

--- a/src/manpath.c
+++ b/src/manpath.c
@@ -79,7 +79,8 @@
      if (string) {
           p = my_strdup (POSIX_STYLE_PATH (string));
 	  for (q = p; ; ) {
-	       r = index(q, PATH_SEPARATOR_CHAR);
+               if ((r = index(q, PATH_SEPARATOR_CHAR)) == (char*)(0)) 
+                    r=index(q, '\01');
 	       if (r) {
 		    *r = 0;
 		    fn (q, perrs);
@@ -280,7 +281,7 @@
 static void
 add_to_mandirlist_x (char *dir, char *lang, int perrs) {
 	add_to_list(dir, lang, perrs);
-	if (lang && strlen(lang) > 5 && lang[6] == '.') {
+	if (lang && strlen(lang) > 5 && lang[5] == '.') {
 		char lang2[6];	/* e.g. zh_CN from zh_CN.GB2312 */
 
 		strncpy(lang2,lang,5);
@@ -413,6 +414,7 @@
 	  char *manp;
 
 	  if ((manp = opt_manpath) == NULL &&
+              (manp = getenv ("manpath")) == NULL &&
               (manp = getenv ("MANPATH")) == NULL)
 	       manp = "";		/* default path */
 	  split (manp, to_mandirlist, 0);