diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 8ad4922..bafd832 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -985,12 +985,12 @@ class BBCooker:
         """
         Find the .bb files which match the expression in 'buildfile'.
         """
-
         if bf.startswith("/") or bf.startswith("../"):
             bf = os.path.abspath(bf)
         filelist, masked = self.collect_bbfiles()
         try:
             os.stat(bf)
+            bf = os.path.abspath(bf)
             return [bf]
         except OSError:
             regexp = re.compile(bf)
